]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: do not delete mismatched root refs
authorJosef Bacik <josef@toxicpanda.com>
Wed, 18 Dec 2019 22:20:29 +0000 (17:20 -0500)
committerDavid Sterba <dsterba@suse.com>
Wed, 8 Jan 2020 13:44:24 +0000 (14:44 +0100)
commit5d3933c418f0d85dbf01d04403b911130be9ae7f
tree4a1e3f9dcd3a58b5122271792a53c2510698fce3
parent951470cef8873fc7cda0181ef1ec06ccc3e4dd94
btrfs: do not delete mismatched root refs

btrfs_del_root_ref() will simply WARN_ON() if the ref doesn't match in
any way, and then continue to delete the reference.  This shouldn't
happen, we have these values because there's more to the reference than
the original root and the sub root.  If any of these checks fail, return
-ENOENT.

CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/root-tree.c