mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
generic: test for fsync after file truncations
Test that if we truncate a file to a smaller size, then truncate it to its original size or a larger size, then fsyncing it and a power failure happens, the file will have the range [first_truncate_size, last_size[ with all bytes having a value of 0x00 if we read it the next time the filesystem is mounted. This test is motivated by a bug found in btrfs, which is fixed by a patch titled: "Btrfs: fix fsync after truncate when no_holes feature is enabled" Tested against ext3/4, xfs, btrfs (with and without the fix, and with the no_holes feature disabled), f2fs, reiserfs and nilfs2. All filesystems pass the test except for unpatched btrfs with the no_holes feature enabled (as expected) and f2fs. Both produce the following file contents that differ from the golden output: File foo content after log replay: 0000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa * 0200000 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb * 0372000 File bar content after log replay: 0000000 ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee * 0200000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff * 0372000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 0772000 Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
43b3882db9
commit
9dcfb88ac6
@@ -103,6 +103,7 @@
|
||||
098 auto quick metadata
|
||||
099 udf auto
|
||||
100 udf auto
|
||||
101 auto quick metadata
|
||||
105 acl auto quick
|
||||
112 rw aio auto quick
|
||||
113 rw aio auto quick
|
||||
|
||||
Reference in New Issue
Block a user