generic: add testcase to test fallocate & f{data,}sync

f2fs can skip isize updating in fsync(), since during mount, f2fs
tries to recovery isize according to valid block address or
preallocated flag in last fsynced dnode block.

However, fallocate() breaks our rule with setting
FALLOC_FL_KEEP_SIZE flag, since it can preallocated block cross EOF,
once the file is fsynced, in POR, we will recover isize incorrectly
based on these fallocated blocks.

This patch adds a new testcase to test fallocate, in order to verify
whether filesystem will do correct recovery on isize.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Chao Yu
2017-11-15 16:58:33 +08:00
committed by Eryu Guan
parent 742facac0d
commit eb48c30502
3 changed files with 138 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
QA output created by 468
==== falloc 1024 test with fsync ====
==== falloc 4096 test with fsync ====
==== falloc 104857600 test with fsync ====
==== falloc -k 1024 test with fsync ====
==== falloc -k 4096 test with fsync ====
==== falloc -k 104857600 test with fsync ====
==== falloc 1024 test with fdatasync ====
==== falloc 4096 test with fdatasync ====
==== falloc 104857600 test with fdatasync ====
==== falloc -k 1024 test with fdatasync ====
==== falloc -k 4096 test with fdatasync ====
==== falloc -k 104857600 test with fdatasync ====