From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4C54C77B7F for ; Thu, 26 Jun 2025 05:35:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 23A7B6B00C4; Thu, 26 Jun 2025 01:35:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2112E6B00C5; Thu, 26 Jun 2025 01:35:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 14E506B00C6; Thu, 26 Jun 2025 01:35:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 023DE6B00C4 for ; Thu, 26 Jun 2025 01:35:58 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AFCB2160774 for ; Thu, 26 Jun 2025 05:35:58 +0000 (UTC) X-FDA: 83596440396.23.BDF0CB0 Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) by imf29.hostedemail.com (Postfix) with ESMTP id E2B6C120006 for ; Thu, 26 Jun 2025 05:35:56 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=a4FgOprC; spf=pass (imf29.hostedemail.com: domain of hughd@google.com designates 209.85.219.171 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750916156; a=rsa-sha256; cv=none; b=fExM83frk0AXMXPBs2SMbC9e+nhEjPpvjEHeSCeSzDNQyqu9IDalO2+uN/4z/q17Oy/zSo DYj2fAeVlZCZT/ASX4vV1tyXCWt4dw71Q/UOiWBsDmOr9H8LiLYj1lG1/40HRYtCYB7WXr 2+ecOkOebu7AVs6zAksy0cSRYD9GMQY= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=a4FgOprC; spf=pass (imf29.hostedemail.com: domain of hughd@google.com designates 209.85.219.171 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750916156; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5vxhDewb5b0Ywq//yQwZJDFdzV5efFF01/yEbvDHOXA=; b=vOscNewS7eh1NaCz9GRHBLWYByDop7tXwFlqxaj48YcxhtX2dFLxqhxA21+tJr1Ft/NvCZ 3ZvPv2t7pxK6fMs8WMMVQKq956HmijSuKceN7niEDovTy3b2bobQ51ZYtuQfGOdq35haS4 gSW+tnv1mbHjiE9f487NQ1yX62sqAvs= Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-e8600a33792so399970276.0 for ; Wed, 25 Jun 2025 22:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750916156; x=1751520956; darn=kvack.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=5vxhDewb5b0Ywq//yQwZJDFdzV5efFF01/yEbvDHOXA=; b=a4FgOprCjyLH6IckQpCbHphK8gv2uKV0QJGWbjQg7S2XIXBwVX624WDsjr1uleQ7Lc pwpoeFvQZz8z7dylHbXBQoZtlrX4K4ZaVnDGaVh7FDtEQZH35g5SzQUpICRczT/+mOBB 5JuIzgZlasrg8JHrn25OF0pqlRi8fPQWG/QJ7N9jCF63gWC2SMC+vIPTG7kk8vmK69aM DELTYJSb5J/lRVkzUrrwkST39bHsHKaEUp45mIR67frLhswPNkoDEyeVzucSJHdfY2gK zRp0HDe4OBmQP7k7wQfAgsfldCNxs7mle0VpEOU5PO6jtlaHMIqAObeqES4cyp7QPTxX BaBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750916156; x=1751520956; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5vxhDewb5b0Ywq//yQwZJDFdzV5efFF01/yEbvDHOXA=; b=eEk1TS72dIgh/qw0uigjN+86LOO5zESDMSHmioxV9uhVo0t9BzN7/OLx4oF6xHXkW5 9VXe+z6voafQ9Nm+oZ5inwjRUf5BMeYhHtec+r4qLd0wU0xXVJeXqUaiujCaY3fr/dd3 lvtWgqr6UFgDW3uDoKI6WEhIMgBp2XVf6ga7uMi/N8G4aBroHnYxm0aZQnQuIbzrzBfB PuyqrMPilRNMvoINGDHntVOs9U8JgV27NX9Qk792EDJBS+FDrjCO7bmAPkzGX10wqJc9 VrsZKkq9OBashOeNw1ix25xv7t9rXqbhPI163GagyXl2CiwNv4vaq0WFWl1RR77qX75B NVmw== X-Gm-Message-State: AOJu0YwdoeozzCDeGykNqplq2BbZrnplen0xFJ+Yq9eUGPrU/ogp6MFR ntNSTgf1kp0MQ7HCZLsJgm7bGqiZ6oTFmNYYI+Pdp4uz43q5oORzSgGI87AEDOaZkQ== X-Gm-Gg: ASbGncskzp9SXcI3nPNv0wNbh92lbjJy+yO4RDuOX65i2hiGPbgKkMrG5Q8h3BQkkoS zECSiXbs/YEoSvWOJcPWvw2U0WBpAnHgfltfecGcUxW+uuK+cOf8+ibuQ7tGgFTIi+pT2Ztju/M 8CfVSWcT4pkHRH0oLPvpnQcBvQQJlOT5B/5n+XScVMJVdGQ9v2nafneAUuqLcRfirEPf5hLXDg6 y54+qvHeWWtY3PJ3bvB6pAGYywCm/0p7RPXVO7kPk5G/cZ5sN2zgrg1xSwOiUZ4vfWT3rjQ9Wdk pqle/yMuPg+nBAZCyl69llfX6lrXE4FQw6E6TgHPq21iO8g6jC9H+xBvmFBnzmyN8w2/einDfJj Qg0qArKMUwx+jo3bIsibadeqvt1DRKojrmUTxNiV7q6gA3kg= X-Google-Smtp-Source: AGHT+IEMSKLrO8EtKfdXJ2WZVY05Fq2nkLJ5b+Rc+iIGej52C/mkk64x4jX2h+i9Nru0vwzzqyfYVQ== X-Received: by 2002:a05:6902:6881:b0:e87:9d96:d76f with SMTP id 3f1490d57ef6-e879d96dc61mr1547584276.13.1750916155741; Wed, 25 Jun 2025 22:35:55 -0700 (PDT) Received: from darker.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e842aabb57dsm4133678276.5.2025.06.25.22.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jun 2025 22:35:54 -0700 (PDT) Date: Wed, 25 Jun 2025 22:35:44 -0700 (PDT) From: Hugh Dickins To: Matthew Wilcox , Brian Foster cc: linux-mm@kvack.org, Hugh Dickins , Baolin Wang Subject: Re: [PATCH] tmpfs: zero post-eof folio range on file extension In-Reply-To: Message-ID: References: <20250625184930.269727-1-bfoster@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Stat-Signature: frpwbwio81idajnd7q4wwmk6ikun4sr7 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E2B6C120006 X-Rspam-User: X-HE-Tag: 1750916156-49484 X-HE-Meta: U2FsdGVkX19SFYVvQIWQQRSk8PoJAImAdzDM6S+UglC7NhEJV8+pZ0QpnGeq91Ck/Fe+VCeBjwuTZSz0qDWkAm/XAah4e7v01U4xcgM6LqC1PiaYQdy/bUubahzmadKS0gx0fAtvSeyi9YPtHQogrwDXqONCxYQ13s4GhwNPLUR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O3S1I4zY689qhBObtXpslJrosEQdSYrUdTdZQMlErVBXHhWw+eFGhplLyycZ9+WZCcgT1nMZgektWGc3zORedKv+n3Xwvx2rRayqeAsr8a1ldbFD82ZP0yr20vChdjDAOoX9SZBQfog0w0K1mVLYjp6WncrtF1AL6w3TpXGzlNYiKMfsfV0B+1kzcZsE8C X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, 25 Jun 2025, Matthew Wilcox wrote: > On Wed, Jun 25, 2025 at 02:49:30PM -0400, Brian Foster wrote: > > Most traditional filesystems zero the post-eof portion of the eof > > folio at writeback time, or when the file size is extended by > > truncate or extending writes. This ensures that the previously > > post-eof range of the folio is zeroed before it is exposed to the > > file. > > > > tmpfs doesn't implement the writeback path the way a traditional > > filesystem does, so zeroing behavior won't be exactly the same. > > However, it can still perform explicit zeroing from the various > > operations that extend a file and expose a post-eof portion of the > > eof folio. The current lack of zeroing is observed via failure of > > fstests test generic/363 on tmpfs. This test injects post-eof mapped > > writes in certain situations to detect gaps in zeroing behavior. > > > > Add a new eof zeroing helper for file extending operations. Look up > > the current eof folio, and if one exists, zero the range about to be > > exposed. This allows generic/363 to pass on tmpfs. > > This seems like what I did here? > > https://lore.kernel.org/linux-fsdevel/20230202204428.3267832-4-willy@infradead.org/ > > Which fix should we prefer? Thank you Brian, thank you Matthew. Of course my immediate reaction is to prefer the smaller patch, Matthew's, but generic/363 still fails with that one: I need to look into what each of you is doing (and that mail thread from 2023) and make up my own mind. (I'm worried why I had no copy of Matthew's 2023 patch: it's sadly common for me to bury patches for long periods of time, but not usually to lose them completely. But that is my worry, not yours.) I haven't been much concerned by generic/383 failing on tmpfs: but promise to respect your efforts in due course. I procrastinate "in due course" because (a) the full correct answwer will depend on what happens with large folios, and (b) large folio work in 6.14 changed (I'll say broke) the behaviour of huge=always at eof (I expected a danger of that, and thought I checked before 6.14-rc settled, but must have messed up my checking somehow). So there's more (and more urgent) to sort out before settling on the right generic/383 fix. Thanks, Hugh