Skip to content
Commit 2b9dbef2 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason
Browse files

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: default avatarJosef Bacik <jbacik@fb.com>
Tested-by: default avatarHolger Hoffstätte <holger.hoffstaette@googlemail.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 50745b0a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment