summaryrefslogtreecommitdiffstats
path: root/fs/fat/fat.h
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2014-12-12 16:57:26 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-13 12:42:51 -0800
commitc0ef0cc9d277f0f2a83b5a287a816b3916d9f026 (patch)
tree8dc88d4fc0de0bb485578ad6482044a0ecfdef2d /fs/fat/fat.h
parentf441ada0040ed35572df517293b44a9998cc022d (diff)
downloadop-kernel-dev-c0ef0cc9d277f0f2a83b5a287a816b3916d9f026.zip
op-kernel-dev-c0ef0cc9d277f0f2a83b5a287a816b3916d9f026.tar.gz
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>
Diffstat (limited to 'fs/fat/fat.h')
-rw-r--r--fs/fat/fat.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index e0c4ba3..64e295e 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
@@ -370,6 +370,7 @@ extern int fat_file_fsync(struct file *file, loff_t start, loff_t end,
int datasync);
/* fat/inode.c */
+extern int fat_block_truncate_page(struct inode *inode, loff_t from);
extern void fat_attach(struct inode *inode, loff_t i_pos);
extern void fat_detach(struct inode *inode);
extern struct inode *fat_iget(struct super_block *sb, loff_t i_pos);
OpenPOWER on IntegriCloud