]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: bugfix: ignore the wrong key for indirect tree block backrefs
authorJan Schmidt <list.btrfs@jan-o-sch.net>
Tue, 15 May 2012 15:55:51 +0000 (17:55 +0200)
committerJan Schmidt <list.btrfs@jan-o-sch.net>
Sat, 26 May 2012 10:17:51 +0000 (12:17 +0200)
commitfd4c7d32b50dc138a886bcb3604515f0b06691d2
tree791a9d9f670bacfd153680f9ef992f40099734bd
parent1b2636a89ba25ae8e2ecc15b8ec08799bf81957f
Btrfs: bugfix: ignore the wrong key for indirect tree block backrefs

The key we store with a tree block backref is only a hint. It is set when
the ref is created and can remain correct for a long time. As the tree is
rebalanced, however, eventually the key no longer points to the correct
destination.

With this patch, we change find_parent_nodes to no longer add keys unless it
knows for sure they're correct (e.g. because they're for an extent data
backref). Then when we later encounter a backref ref with no parent and no
key set, we grab the block and take the first key from the block itself.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
fs/btrfs/backref.c