提交 1372f8e6 编写于 作者: C Chris Mason

Properly call btrfs_search_slot while shrinking

The shrinking code used btrfs_next_leaf to find the next item, but
this does not cow the blocks it touches.  This fix calls search_slot after
finding the next item to do appropriate cow and balancing.
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 25524883
......@@ -2434,7 +2434,15 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
break;
}
leaf = path->nodes[0];
nritems = btrfs_header_nritems(leaf);
btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
/*
* btrfs_next_leaf doesn't cow buffers, we have to
* do the search again
*/
memcpy(&key, &found_key, sizeof(key));
btrfs_release_path(root, path);
continue;
}
btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册