mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-04 04:03:04 +09:00
Btrfs: Fix oopsen when dropping empty tree.
commit 7a7965f83e upstream.
When dropping a empty tree, walk_down_tree() skips checking
extent information for the tree root. This will triggers a
BUG_ON in walk_up_proc().
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Acked-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4c324840d6
commit
fa3c9782cd
@@ -5402,10 +5402,6 @@ static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
|
||||
int ret;
|
||||
|
||||
while (level >= 0) {
|
||||
if (path->slots[level] >=
|
||||
btrfs_header_nritems(path->nodes[level]))
|
||||
break;
|
||||
|
||||
ret = walk_down_proc(trans, root, path, wc, lookup_info);
|
||||
if (ret > 0)
|
||||
break;
|
||||
@@ -5413,6 +5409,10 @@ static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
|
||||
if (level == 0)
|
||||
break;
|
||||
|
||||
if (path->slots[level] >=
|
||||
btrfs_header_nritems(path->nodes[level]))
|
||||
break;
|
||||
|
||||
ret = do_walk_down(trans, root, path, wc, &lookup_info);
|
||||
if (ret > 0) {
|
||||
path->slots[level]++;
|
||||
|
||||
Reference in New Issue
Block a user