Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] btrfs-progs: Fix block groups read which may skip certain block groups
@ 2019-10-30  7:27 Qu Wenruo
  2019-11-01 11:27 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Qu Wenruo @ 2019-10-30  7:27 UTC (permalink / raw)
  To: linux-btrfs

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(+)

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;
-- 
2.23.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs-progs: Fix block groups read which may skip certain block groups
  2019-10-30  7:27 [PATCH] btrfs-progs: Fix block groups read which may skip certain block groups Qu Wenruo
@ 2019-11-01 11:27 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2019-11-01 11:27 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30  7:27 [PATCH] btrfs-progs: Fix block groups read which may skip certain block groups Qu Wenruo
2019-11-01 11:27 ` David Sterba

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git