提交 7a7965f8 编写于 作者: Y Yan, Zheng 提交者: Chris Mason

Btrfs: Fix oopsen when dropping empty tree.

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: NYan Zheng <zheng.yan@oracle.com>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 d7ce5843
...@@ -5402,10 +5402,6 @@ static noinline int walk_down_tree(struct btrfs_trans_handle *trans, ...@@ -5402,10 +5402,6 @@ static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
int ret; int ret;
while (level >= 0) { while (level >= 0) {
if (path->slots[level] >=
btrfs_header_nritems(path->nodes[level]))
break;
ret = walk_down_proc(trans, root, path, wc, lookup_info); ret = walk_down_proc(trans, root, path, wc, lookup_info);
if (ret > 0) if (ret > 0)
break; break;
...@@ -5413,6 +5409,10 @@ static noinline int walk_down_tree(struct btrfs_trans_handle *trans, ...@@ -5413,6 +5409,10 @@ static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
if (level == 0) if (level == 0)
break; break;
if (path->slots[level] >=
btrfs_header_nritems(path->nodes[level]))
break;
ret = do_walk_down(trans, root, path, wc, &lookup_info); ret = do_walk_down(trans, root, path, wc, &lookup_info);
if (ret > 0) { if (ret > 0) {
path->slots[level]++; path->slots[level]++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册