Commit 47b71abd authored by Rajeev Mishra's avatar Rajeev Mishra Committed by Jens Axboe
Browse files

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: default avatarRajeev Mishra <rajeevm@hpe.com>
Reviewed-by: default avatarYu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20250818184821.115033-3-rajeevm@hpe.com


[axboe: massage commit message]
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8aa5a3b6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment