]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Btrfs: fix warning in backref walking
authorLiu Bo <bo.li.liu@oracle.com>
Tue, 28 Jul 2015 10:03:30 +0000 (18:03 +0800)
committerChris Mason <clm@fb.com>
Sun, 9 Aug 2015 14:33:50 +0000 (07:33 -0700)
commitacdf898de8903f50bb10bbce4b774432bcd63c85
tree79d2c35cc5ec383bb0edff3ec5c116b4c902622b
parent166f66d0bc94a14ec4bc6ee6ab079532df4a8d9e
Btrfs: fix warning in backref walking

When we do backref walking, we search firstly in queued delayed refs
and then the on-disk backrefs, but we parse differently for shared
references, for delayed refs we also add 'ref->root' while for on-disk
backrefs we don't, this can prevent us from merging refs indexed
by the same bytenr and cause find_parent_nodes() to throw a warning at
'WARN_ON(ref->count < 0)', for example, when we have a shared data extent
with 'ref_cnt=1' and a delayed shared data with a BTRFS_DROP_DELAYED_REF,
that happens.

For shared references, no matter if it's delayed or on-disk, ref->root is
not at all used, instead it's ref->parent that really matters, so this has
delayed refs handled as the same way as on-disk refs.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/backref.c