generic: test creating a symlink and then fsync its parent directory
authorFilipe Manana <fdmanana@suse.com>
Mon, 9 May 2016 00:57:39 +0000 (10:57 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 9 May 2016 00:57:39 +0000 (10:57 +1000)
commit238397db22fd881422a98c4fa5f7a9fc68ec66a6
tree088427db8f227218c638790110bdb722ee623ffc
parent5da816de1a24652b7736234ee9737387c78a90b8
generic: test creating a symlink and then fsync its parent directory

Test creating a symlink, fsync its parent directory, power fail and mount
again the filesystem. After these steps the symlink should exist and its
content must match what we specified when we created it (must not be
empty or point to something else).

This is motivated by an issue in btrfs where after the log replay happens
we get empty symlinks, which not only does not make much sense from a
user's point of view, it's also not valid to have empty links in linux
(wgich is explicitly forbidden by the symlink(2) system call).

The issue in btrfs is fixed by the following patch for the linux kernel:

  "Btrfs: fix empty symlink after creating symlink and fsync parent dir"

Tested against ext3, ext4, xfs, f2fs, reiserfs and nilfs2.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/generic/348 [new file with mode: 0755]
tests/generic/348.out [new file with mode: 0644]
tests/generic/group