]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
f2fs/013: test to check potential corruption on atomic_write file
authorChao Yu <chao@kernel.org>
Fri, 9 May 2025 06:07:54 +0000 (14:07 +0800)
committerZorro Lang <zlang@kernel.org>
Fri, 23 May 2025 13:53:18 +0000 (21:53 +0800)
commit75372b7617a2e6c3f150eaa0d925b177a6966314
treefe79ec0fd180d35cb4540f97284a5437709848cd
parent68fa350e1e776b6179cda4847c9f68070d2251c9
f2fs/013: test to check potential corruption on atomic_write file

This is a regression testcase to check whether we will handle database
inode dirty status correctly:
1. mount f2fs image w/ timeout fault injection option
2. create a regular file, and write data into the file
3. start transaction on the file (via F2FS_IOC_START_ATOMIC_WRITE)
4. write transaction data to the file
5. commit and end the transaction (via F2FS_IOC_COMMIT_ATOMIC_WRITE)
6. meanwhile loop call fsync in parallel
Before f098aeba04c9 ("f2fs: fix to avoid atomicity corruption of atomic
file"), database file may become corrupted after atomic write while
there is concurrent dirty inode flush in background.

Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/f2fs/013 [new file with mode: 0755]
tests/f2fs/013.out [new file with mode: 0644]