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

Message ID 20191030072711.73858-1-wqu@suse.com
State New
Headers show
Series
  • btrfs-progs: Fix block groups read which may skip certain block groups
Related show

Commit Message

Qu Wenruo Oct. 30, 2019, 7:27 a.m. UTC
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.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 extent-tree.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Sterba Nov. 1, 2019, 11:27 a.m. UTC | #1
On Wed, Oct 30, 2019 at 03:27:11PM +0800, Qu Wenruo wrote:
> 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.

Patch
diff mbox series

diff --git a/extent-tree.c b/extent-tree.c
index 443f327a6bed..52b963265a07 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -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;