diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-06-04 16:54:52 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-06-19 13:52:52 -0400 |
commit | 7e992408e3723bdb14f4af4f970b12f8f76d0b14 (patch) | |
tree | 0775d0611435c005e18f3b5a03ffad3598a41cd4 /version.sh | |
parent | b3be7aea12b3f974895191026cb012f6fa78203c (diff) |
Btrfs-progs: fix incorrect root backref errors in fsck
A user reported that fsck was complaining about unresolved refs for some
snapshots. You can reproduce this by doing
mkfs.btrfs /dev/sdb
mount /dev/sdb /mnt
btrfs subvol snap /mnt/ /mnt/a
btrfs subvol snap /mnt/ /mnt/b
btrfs subvol del /mnt/a
umount /mnt
btrfsck /dev/sdb
and you'd get this
unresolved ref root 258 dir 256 index 2 namelen 1 name a error 600
because snapshot b has a dir item that points to a. Except we encode in our
root ref the dirid of the ref holder, and if it doesn't match we just give it
back a empty directory since we can't hardlink directories. This makes the
check in btrfsck bogus, when we delete a we remove the ref key for it so any
lookups into /mnt/b/a will just give a blank directory as it's supposed to. Fix
this by only saying the backref is reachable if there is both a DIR_ITEM and a
REF_KEY for the given root. With this patch I no longer see errors when running
this reproducer. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'version.sh')
0 files changed, 0 insertions, 0 deletions