linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] exfat: fix i_blocks for files truncated over 4 GiB
@ 2021-11-18 21:28 Christophe Vu-Brugier
  2021-11-18 21:28 ` [PATCH 1/1] " Christophe Vu-Brugier
  0 siblings, 1 reply; 7+ messages in thread
From: Christophe Vu-Brugier @ 2021-11-18 21:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Namjae Jeon, Sungjong Seo, Christophe Vu-Brugier

From: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>

The following patch fixes an issue in the exFAT driver. The number of
allocated blocks becomes wrong if a file is truncated over 4 GiB.

A similar issue was fixed last month by Sungjong Seo:

  commit 0c336d6e33f4 ("exfat: fix incorrect loading of i_blocks for
                        large files")

Below is a test case for the issue. A 7 GiB file is truncated to 5 GiB
but stat() st_blocks shows only 1 GiB being used.

$ dd if=/dev/urandom of=file.bin bs=1024k count=7168

$ /sbin/xfs_io -c "stat" file.bin
fd.path = "file.bin"
fd.flags = non-sync,non-direct,read-write
stat.ino = 11
stat.type = regular file
stat.size = 7516192768
stat.blocks = 14680064

$ /sbin/xfs_io -c "truncate 5368709120" file.bin

$ /sbin/xfs_io -c "stat" file.bin
fd.path = "file.bin"
fd.flags = non-sync,non-direct,read-write
stat.ino = 11
stat.type = regular file
stat.size = 5368709120
stat.blocks =  2097152

Christophe Vu-Brugier (1):
  exfat: fix i_blocks for files truncated over 4 GiB

 fs/exfat/file.c  | 2 +-
 fs/exfat/super.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-22  2:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-18 21:28 [PATCH 0/1] exfat: fix i_blocks for files truncated over 4 GiB Christophe Vu-Brugier
2021-11-18 21:28 ` [PATCH 1/1] " Christophe Vu-Brugier
2021-11-18 21:50   ` Matthew Wilcox
2021-11-18 22:43     ` Christophe Vu-Brugier
2021-11-19 17:37     ` [PATCH v2] " Christophe Vu-Brugier
2021-11-22  2:10       ` Sungjong Seo
2021-11-22  2:33         ` Namjae Jeon

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).