]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
generic: test fsync of a file truncated to a length of zero
authorFilipe Manana <fdmanana@suse.com>
Tue, 17 Feb 2026 18:33:30 +0000 (18:33 +0000)
committerZorro Lang <zlang@kernel.org>
Fri, 20 Feb 2026 15:51:43 +0000 (23:51 +0800)
commit75bbf15c562942d9329fb44ea3b6190509c8f748
tree171a2e899c42a7d7c1331d70e8737fe0fa89cbd3
parentc26276f53d58477010364a8b1b0fd209a6c943f1
generic: test fsync of a file truncated to a length of zero

Test that if we truncate a file to 0, fsync it, add a hard link to the
file and then fsync the parent directory, after a power failure the file
has a size of 0 (and the hardlink exists too).

This exercises a bug fixed by the following kernel patch for btrfs:

  "btrfs: fix zero size inode with non-zero size after log replay"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/789 [new file with mode: 0755]
tests/generic/789.out [new file with mode: 0644]