Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp321557pxb; Thu, 31 Mar 2022 06:19:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvVm+zaqSYLW7RxUyWAsFL7fH8sn2HCd1etm5aXGzqncAlwpBKcubu1tzriF1juT570fhZ X-Received: by 2002:a17:907:7e8a:b0:6e0:2fed:8e01 with SMTP id qb10-20020a1709077e8a00b006e02fed8e01mr5067863ejc.0.1648732765220; Thu, 31 Mar 2022 06:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648732765; cv=none; d=google.com; s=arc-20160816; b=mwLimXGPReA2eI/iyAVP/1R8f82L3FRB8n07FuFda8TnH/oNxnz9l7mxnxOUAzWe0J nDIx3COEmQDPGzW+ZfgEVKQzXL9X69fULFdEkzvnLhUG8p/UOlE6tsZ7nXJjVk8B0anJ WAaFE95SIe9swKpM3O7RralqbOck91h/5qO8cNC1btBuKn7oPQINKmRywAFI+M8jWIBu nLE6YpqbxtgoRj4KRGtelIICcPVcsLfmDwAOi0K1hw1xH/OjZwE8wFJooiWWkiN2nsdU iKrhU+oTGq3qoexHwIxRcixhvaiI0pGXrPxG/7/RORJAWAM7RK7meCbH2KnHX3hWDSIS Mb9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:references :in-reply-to:message-id:date; bh=99fiiCYeJL7cjAlrMnsMQb+irmnYLvJn+UjMTekmmSA=; b=zhRcGVyeJZZstULMy7bBuN4WgskHtELzqxXkSc50TxxfAt7uz40cDjVqi1uj0XiZdh 0h4CLPvPuHVhIBQpqN8CoyqU8chPgUcSzs3IpZQwbR8OX4L0+C5XgeNiXOg5ZMX2MmeQ MDje9bkh/IJfN2trHvho17T6CG7oh861IAd9DGQ6pS6YeaaQc0MBcXIh00bm+dTTMWJQ 55kDFYbxlIVKOQ8KZmGSjB29ZFmomHwWNTRz0W0PQ3i8h+PlhswGYSZpIsUCxRrC6eC/ o1oxlnZKN/g2TotJ7fgnu+KhjJzkcc/x/SASInJ1Wf5bujLyeaeXYI0WjVZynVwpEuMp Pgcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g22-20020a17090613d600b006dfe2af50f2si24368813ejc.191.2022.03.31.06.18.57; Thu, 31 Mar 2022 06:19:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232873AbiCaIeM (ORCPT + 99 others); Thu, 31 Mar 2022 04:34:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbiCaIeL (ORCPT ); Thu, 31 Mar 2022 04:34:11 -0400 X-Greylist: delayed 29513 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 31 Mar 2022 01:32:23 PDT Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3F5311A09; Thu, 31 Mar 2022 01:32:22 -0700 (PDT) Received: from mse-fl1.zte.com.cn (unknown [10.30.14.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4KTc4450k8zBCBjq; Thu, 31 Mar 2022 16:32:20 +0800 (CST) Received: from szxlzmapp07.zte.com.cn ([10.5.230.251]) by mse-fl1.zte.com.cn with SMTP id 22V8W7XO084002; Thu, 31 Mar 2022 16:32:07 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Thu, 31 Mar 2022 16:32:07 +0800 (CST) Date: Thu, 31 Mar 2022 16:32:07 +0800 (CST) X-Zmail-TransId: 2b0462456707ffffffff8d1-79fab X-Mailer: Zmail v1.0 Message-ID: <202203311632074775168@zte.com.cn> In-Reply-To: <20220331053340.GE1544202@dread.disaster.area> References: 20220331003826.GL27690@magnolia,202203311128598207170@zte.com.cn,20220331053340.GE1544202@dread.disaster.area Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?UTF-8?B?UmU6W1BBVENIXSB4ZnM6IGdldGF0dHIgaWdub3JlIGJsb2NrcyBiZXlvbmQgZW9m?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 22V8W7XO084002 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 62456714.003 by FangMail milter! X-FangMail-Envelope: 1648715540/4KTc4450k8zBCBjq/62456714.003/10.30.14.238/[10.30.14.238]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 62456714.003/4KTc4450k8zBCBjq X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > We do not, and have not ever tried to, hide allocation or block > usage artifacts from userspace because any application that depends > on specific block allocation patterns or accounting from the > filesystem is broken by design. > > Every filesystem accounts blocks differently, and more often than > not the block count exposed to userspace also includes metadata > blocks (extent maps, xattr blocks, etc) and it might multiple count > other blocks (e.g. shared extents). Hence so you can't actually > use it for anything useful in userspace except reporting how many > blocks this file *might* use. > > If your application is dependent on block counts exactly matching > the file data space for waht ever reason, then what speculative > preallocation does is the least of your problems. > Thanks for your explaination. Unfortunately, the app I'm using evaluates diskusage by querying the changes of the backend filesystem (XFS) file before and after the operation. Without giving up the benefits of preallocation, the app's statistics will become obsolete and no chance to correct it at a small cost, because of the silence reclaim of posteof blocks. That is the app's problem. Posteof blocks will be reclaimed sooner or later, it seems reasonable to ignore them directly during query. This is my humble opinion in this patch. At the query moment, it's not real, but it will become so eventually. It's a speculative result for query.