Skip to content

Commit 6c8bf17

Browse files
naotakdave
authored andcommitted
btrfs: fix buffer index in wait_eb_writebacks()
The commit f2cb97e ("btrfs: index buffer_tree using node size") changed the index of buffer_tree from "start >> sectorsize_bits" to "start >> nodesize_bits". However, the change is not applied for wait_eb_writebacks() and caused IO failures by writing in a full zone. Use the index properly. Fixes: f2cb97e ("btrfs: index buffer_tree using node size") Reviewed-by: Qu Wenruo <[email protected]> Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: Naohiro Aota <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent dc5b1d8 commit 6c8bf17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/zoned.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2242,7 +2242,7 @@ static void wait_eb_writebacks(struct btrfs_block_group *block_group)
22422242
struct btrfs_fs_info *fs_info = block_group->fs_info;
22432243
const u64 end = block_group->start + block_group->length;
22442244
struct extent_buffer *eb;
2245-
unsigned long index, start = (block_group->start >> fs_info->sectorsize_bits);
2245+
unsigned long index, start = (block_group->start >> fs_info->nodesize_bits);
22462246

22472247
rcu_read_lock();
22482248
xa_for_each_start(&fs_info->buffer_tree, index, eb, start) {

0 commit comments

Comments
 (0)