btrfs: catch cow on deleting snapshots
authorJosef Bacik <jbacik@fb.com>
Fri, 30 Nov 2018 16:52:13 +0000 (11:52 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:48 +0000 (14:51 +0100)
commit83354f0772cd07828b0fcdf1ef2872fd2032acb8
treed552f12d1a5870ce7be0c6fceff361f558b96265
parent01e0da48856fe964e2a981e5541cee234b8a43a3
btrfs: catch cow on deleting snapshots

When debugging some weird extent reference bug I suspected that we were
changing a snapshot while we were deleting it, which could explain my
bug.  This was indeed what was happening, and this patch helped me
verify my theory.  It is never correct to modify the snapshot once it's
being deleted, so mark the root when we are deleting it and make sure we
complain about it when it happens.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c