2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 20:23:57 +08:00
linux-next/fs/fat
Namjae Jeon c0ef0cc9d2 fat: fix data past EOF resulting from fsx testsuite
When running FSX with direct I/O mode, fsx resulted in DATA past EOF issues.

  fsx ./file2 -Z -r 4096 -w 4096
  ...
  ..
  truncating to largest ever: 0x907c
  fallocating to largest ever: 0x11137
  truncating to largest ever: 0x2c6fe
  truncating to largest ever: 0x2cfdf
  fallocating to largest ever: 0x40000
  Mapped Read: non-zero data past EOF (0x18628) page offset 0x629 is 0x2a4e
  ...
  ..

The reason being, it is doing a truncate down, but the zeroing does not
happen on the last block boundary when offset is not aligned.  Even though
it calls truncate_setsize()->truncate_inode_pages()->
truncate_inode_pages_range() and considers the partial zeroout but it
retrieves the page using find_lock_page() - which only looks the page in
the cache.  So, zeroing out does not happen in case of direct IO.

Make a truncate page based around block_truncate_page for FAT filesystem
and invoke that helper to zerout in case the offset is not aligned with
the blocksize.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-12-13 12:42:51 -08:00
..
cache.c fs/fat: fix two checkpatch issues in cache.c 2012-10-06 03:05:10 +09:00
dir.c vfs: make first argument of dir_context.actor typed 2014-10-31 17:48:54 -04:00
fat.h fat: fix data past EOF resulting from fsx testsuite 2014-12-13 12:42:51 -08:00
fatent.c fat: no need to reset EOF in ent_put for FAT32 2012-10-06 03:05:12 +09:00
file.c fat: fix data past EOF resulting from fsx testsuite 2014-12-13 12:42:51 -08:00
inode.c fat: fix data past EOF resulting from fsx testsuite 2014-12-13 12:42:51 -08:00
Kconfig vfat: Note the NLS requirement 2009-04-17 09:32:11 -07:00
Makefile fat (exportfs): move NFS support code 2012-10-06 03:05:09 +09:00
misc.c fat: remove redundant sys_tz declaration 2014-10-14 02:18:20 +02:00
namei_msdos.c Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
namei_vfat.c fat: fix oops on corrupted vfat fs 2014-12-03 09:36:03 -08:00
nfs.c fat (exportfs): rebuild directory-inode if fat_dget() 2013-04-29 18:28:41 -07:00