]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: don't create or leak aliased root while cleaning up orphans
authorJeff Mahoney <jeffm@suse.com>
Thu, 18 Aug 2016 01:58:33 +0000 (21:58 -0400)
committerChris Mason <clm@fb.com>
Thu, 25 Aug 2016 10:58:29 +0000 (03:58 -0700)
commitcdc51e876a9e5883d18b4995a08ebb3d41dc9d66
tree4ff7e4a0ac701e26985efb0d24c0ea3665791ffc
parentcf460997ecd310887d1075db84a0b2f543ceb9f5
btrfs: don't create or leak aliased root while cleaning up orphans

commit 2eca57e6f46 (Btrfs: fix loading of orphan roots leading to BUG_ON)
avoids the BUG_ON but can add an aliased root to the dead_roots list or
leak the root.

Since we've already been loading roots into the radix tree, we should
use it before looking the root up on disk.

Cc: <stable@vger.kernel.org> # 4.5
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/root-tree.c