aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dev-replace.c
diff options
context:
space:
mode:
authorFilipe Manana <[email protected]>2016-04-25 03:45:02 +0000
committerFilipe Manana <[email protected]>2016-05-13 00:59:12 +0000
commit3f9749f6e9edcf8ec569fb542efc3be35e06e84a (patch)
tree7cc406f97a7fbca0a52e80bf63e123fd15c7201d /fs/btrfs/dev-replace.c
parentBtrfs: fix for incorrect directory entries after fsync log replay (diff)
downloadkernel-3f9749f6e9edcf8ec569fb542efc3be35e06e84a.tar.gz
kernel-3f9749f6e9edcf8ec569fb542efc3be35e06e84a.zip
Btrfs: fix empty symlink after creating symlink and fsync parent dir
If we create a symlink, fsync its parent directory, crash/power fail and mount the filesystem, we end up with an empty symlink, which not only is useless it's also not allowed in linux (the man page symlink(2) is well explicit about that). So we just need to make sure to fully log an inode if it's a symlink, to ensure its inline extent gets logged, ensuring the same behaviour as ext3, ext4, xfs, reiserfs, f2fs, nilfs2, etc. Example reproducer: $ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt $ mkdir /mnt/testdir $ sync $ ln -s /mnt/foo /mnt/testdir/bar $ xfs_io -c fsync /mnt/testdir <power fail> $ mount /dev/sdb /mnt $ readlink /mnt/testdir/bar <empty string> A test case for fstests follows soon. Signed-off-by: Filipe Manana <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions