Skip to contentSkip to conversation

btrfs-progs: Fix block groups read which may skip certain block groups

PATCH In review Qu Wenruo 2 participants 2 messages Oct 30, 2019 – Nov 1, 2019 Btrfs file system

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

PATCH 1/1 btrfs-progs: Fix block groups read which may skip certain block groups

Previous patch "btrfs-progs: Refactor btrfs_read_block_groups()" lacks a fix which is in kernel counter part but not in btrfs-progs.

It doesn't reset the key.offset used to search next block group, thus btrfs-progs can skip certain block groups items.

This can fail fsck/039 test case.

Please fold this fix into that patch.

---
 extent-tree.c | 1 +
 1 file changed, 1 insertion(+)
extent-tree.c +1 -0
index 443f327a6bed..52b963265a07 100644
@@ -2747,6 +2747,7 @@ int btrfs_read_block_groups(struct btrfs_fs_info *fs_info)
 			key.objectid++;
 		else
 			key.objectid = key.objectid + key.offset;
+		key.offset = 0;
 		btrfs_release_path(&path);
 	}
 	ret = 0;
Signature · 1 line
2.23.0
#1 lore raw
Quoted 9 lines · Qu Wenruo

Previous patch "btrfs-progs: Refactor btrfs_read_block_groups()" lacks a fix which is in kernel counter part but not in btrfs-progs.

It doesn't reset the key.offset used to search next block group, thus btrfs-progs can skip certain block groups items.

This can fail fsck/039 test case.

Please fold this fix into that patch.

Folded, thanks.