generic: check inode metadata on f{data}sync after power-cut

This patch adds case to test fsync and fdatasync with power-cuts.

The rule to check is:
1) fsync should guarantee all the inode metadata after power-cut,
2) fdatasync should guarantee i_size and i_blocks at least after
   power-cut.

Note that, in XFS, it allocates more blocks when doing writes, so it
should close the file before fsync in order to get actual i_blocks
after power-cut.  Or, it needs to do truncate the file with a
specific size to turn it off at the beginning.

Suggested-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Jaegeuk Kim
2016-11-21 12:02:49 -08:00
committed by Eryu Guan
parent 083ff5827b
commit c74b1f84f9
3 changed files with 147 additions and 0 deletions
+1
View File
@@ -394,3 +394,4 @@
389 auto quick acl
390 auto freeze stress dangerous
391 auto quick rw
392 auto quick metadata