linux/fs/f2fs
Jaegeuk Kim 944fcfc184 f2fs: check the blocksize before calling generic_direct_IO path
The f2fs supports 4KB block size. If user requests dwrite with under 4KB data,
it allocates a new 4KB data block.
However, f2fs doesn't add zero data into the untouched data area inside the
newly allocated data block.

This incurs an error during the xfstest #263 test as follow.

263 12s ... [failed, exit status 1] - output mismatch (see 263.out.bad)
	--- 263.out	2013-03-09 03:37:15.043967603 +0900
	+++ 263.out.bad	2013-12-27 04:20:39.230203114 +0900
	@@ -1,3 +1,976 @@
	QA output created by 263
	fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
	-fsx -N 10000 -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
	+fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
	+truncating to largest ever: 0x12a00
	+truncating to largest ever: 0x75400
	+fallocating to largest ever: 0x79cbf
	...
	(Run 'diff -u 263.out 263.out.bad' to see the entire diff)
	Ran: 263
	Failures: 263
	Failed 1 of 1 tests

It turns out that, when the test tries to write 2KB data with dio, the new dio
path allocates 4KB data block without filling zero data inside the remained 2KB
area. Finally, the output file contains a garbage data for that region.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-12-26 20:33:07 +09:00
..
acl.c f2fs: fix a deadlock during init_acl procedure 2013-10-28 13:39:09 +09:00
acl.h f2fs: fix a deadlock during init_acl procedure 2013-10-28 13:39:09 +09:00
checkpoint.c f2fs: write dirty meta pages collectively 2013-12-23 10:18:07 +09:00
data.c f2fs: check the blocksize before calling generic_direct_IO path 2013-12-26 20:33:07 +09:00
debug.c f2fs: replace the debugfs_root with f2fs_debugfs_root 2013-12-23 10:18:05 +09:00
dir.c f2fs: introduce F2FS_INODE macro to get f2fs_inode 2013-12-26 20:32:48 +09:00
f2fs.h f2fs: introduce F2FS_INODE macro to get f2fs_inode 2013-12-26 20:32:48 +09:00
file.c f2fs: add unlikely() macro for compiler more aggressively 2013-12-23 10:18:06 +09:00
gc.c f2fs: remove the rw_flag domain from f2fs_io_info 2013-12-23 10:18:07 +09:00
gc.h f2fs: optimize gc for better performance 2013-09-05 13:50:32 +09:00
hash.c f2fs: unify string length declarations and usage 2012-12-28 11:27:53 +09:00
inode.c f2fs: introduce F2FS_INODE macro to get f2fs_inode 2013-12-26 20:32:48 +09:00
Kconfig f2fs: introduce CONFIG_F2FS_CHECK_FS for BUG_ON control 2013-10-29 15:43:01 +09:00
Makefile f2fs: update Kconfig and Makefile 2012-12-11 13:43:42 +09:00
namei.c f2fs: avoid to set wrong pino of inode when rename dir 2013-12-23 10:42:51 +09:00
node.c f2fs: introduce F2FS_INODE macro to get f2fs_inode 2013-12-26 20:32:48 +09:00
node.h f2fs: update several comments 2013-12-23 10:26:03 +09:00
recovery.c f2fs: introduce F2FS_INODE macro to get f2fs_inode 2013-12-26 20:32:48 +09:00
segment.c f2fs: remove the rw_flag domain from f2fs_io_info 2013-12-23 10:18:07 +09:00
segment.h f2fs: introduce sysfs entry to control in-place-update policy 2013-12-23 10:18:07 +09:00
super.c f2fs: introduce sysfs entry to control in-place-update policy 2013-12-23 10:18:07 +09:00
xattr.c f2fs: add unlikely() macro for compiler more aggressively 2013-12-23 10:18:06 +09:00
xattr.h f2fs: support the inline xattrs 2013-08-26 20:15:23 +09:00