]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: keep dropped roots in cache until transaction commit
authorJosef Bacik <jbacik@fb.com>
Tue, 15 Sep 2015 14:07:04 +0000 (10:07 -0400)
committerChris Mason <clm@fb.com>
Tue, 22 Sep 2015 17:22:56 +0000 (10:22 -0700)
commit9409355f819e8e3448f4aa9c25cb3c55c81f670a
tree3b0f2a78c1f601e79a10e902037254a67a70d3b0
parentad26bc142df38e7050204d94ccdc769c0bf4be24
Btrfs: keep dropped roots in cache until transaction commit

When dropping a snapshot we need to account for the qgroup changes.  If we drop
the snapshot in all one go then the backref code will fail to find blocks from
the snapshot we dropped since it won't be able to find the root in the fs root
cache.  This can lead to us failing to find refs from other roots that pointed
at blocks in the now deleted root.  To handle this we need to not remove the fs
roots from the cache until after we process the qgroup operations.  Do this by
adding dropped roots to a list on the transaction, and letting the transaction
remove the roots at the same time it drops the commit roots.  This will keep all
of the backref searching code in sync properly, and fixes a problem Mark was
seeing with snapshot delete and qgroups.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Tested-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent-tree.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h