mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
8039c7cd3c
On a 64k blocksized filesystem, when the test CoWs the file2's offset range [10 * 64k, 19 * 64k], the call to xfs_bmapi_reserve_delalloc() allocates 32 64k blocks. This is because XFS_DEFAULT_COWEXTSZ_HINT has the value of 32 and xfs_get_cowextsz_hint() uses this to compute the extent alignment. This leads to xfs_bmapi_reserve_delalloc() to reserve space corresponding to the file range [0, 32 * 64k] in the inode's cow fork area. On completion of write I/O corresponding to file2's range [10 * 64k, 19 * 64k], xfs_end_io() moves 10 out of the originally allocated 32 64k blocks to the data fork area. The remaining 22 64k blocks linger on in cow fork area of the inode. Later, when servicing the exit() syscall for the xfs_io process, xfs_free_eofblocks() ends up invoking xfs_reflink_cancel_cow_blocks() since i_delayed_blks has the value 22. xfs_reflink_cancel_cow_blocks() indirectly invokes __xfs_free_extent() which returns EIO since XFS_ERRTAG_FREE_EXTENT has been set. This leads to the filesystem to be shutdown. The "rm" command invoked later ends up returning an error and hence the test fails. The test actually requires that the filesystem gets shutdown when executing the "rm" command. To fix the problem, this commit injects the free_extent error after we CoW file2's [10 * 64k, 19 * 64k] range. Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Tested-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
16 lines
441 B
Plaintext
16 lines
441 B
Plaintext
QA output created by 325
|
|
Format filesystem
|
|
Create files
|
|
Check files
|
|
d5a0ed0305c8df4180cb2bf975ecffe8 SCRATCH_MNT/file1
|
|
d5a0ed0305c8df4180cb2bf975ecffe8 SCRATCH_MNT/file2
|
|
CoW a few blocks
|
|
Inject error
|
|
FS should be shut down, touch will fail
|
|
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
|
Remount to replay log
|
|
FS should be online, touch should succeed
|
|
Check files again
|
|
7629bd70d19d7291b448221ac44b26d9 SCRATCH_MNT/file2
|
|
Done
|