linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Rajeev Mishra <rajeevm@hpe.com>
Cc: linux-block@vger.kernel.org,
	Linux Filesystem Development List <linux-fsdevel@vger.kernel.org>,
	Yu Kuai <yukuai3@huawei.com>, Jens Axboe <axboe@kernel.dk>
Subject: [REGRESSION] loop: use vfs_getattr_nosec for accurate file size
Date: Tue, 26 Aug 2025 22:59:39 -0400	[thread overview]
Message-ID: <20250827025939.GA2209224@mit.edu> (raw)

Hi, I was testing 6.17-rc3, and I noticed a test failure in fstest
generic/563[1], when testing both ext4 and xfs.  If you are using my
test appliance[2], this can be trivially reproduced using:

   kvm-xfstests -c ext4/4k generic/563
or
   kvm-xfstests -c xfs/4k generic/563

[1] https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/tests/generic/563
[2] https://github.com/tytso/xfstests-bld/blob/master/Documentation/kvm-quickstart.md

A git bisect pointed the problem at:

commit 47b71abd58461a67cae71d2f2a9d44379e4e2fcf
Author: Rajeev Mishra <rajeevm@hpe.com>
Date:   Mon Aug 18 18:48:21 2025 +0000

    loop: use vfs_getattr_nosec for accurate file size
    
    Use vfs_getattr_nosec() in lo_calculate_size() for getting the file
    size, rather than just read the cached inode size via i_size_read().
    This provides better results than cached inode data, particularly for
    network filesystems where metadata may be stale.
    
    Signed-off-by: Rajeev Mishra <rajeevm@hpe.com>
    Reviewed-by: Yu Kuai <yukuai3@huawei.com>
    Link: https://lore.kernel.org/r/20250818184821.115033-3-rajeevm@hpe.com
    [axboe: massage commit message]
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

... and indeed if I go to 6.17-rc3, and revert this commit,
generic/563 starts passing again.

Could you please take a look, and/or revert this change?  Many thanks!

      	  	      	      	 	- Ted

             reply	other threads:[~2025-08-27  3:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27  2:59 Theodore Ts'o [this message]
2025-08-27  3:13 ` [REGRESSION] loop: use vfs_getattr_nosec for accurate file size Yi Zhang
2025-08-27  3:13 ` Yu Kuai
2025-08-27 14:31   ` Theodore Ts'o
2025-08-27 14:33     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250827025939.GA2209224@mit.edu \
    --to=tytso@mit.edu \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rajeevm@hpe.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).