Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs-progs: Fix block groups read which may skip certain block groups
Date: Wed, 30 Oct 2019 15:27:11 +0800	[thread overview]
Message-ID: <20191030072711.73858-1-wqu@suse.com> (raw)

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


             reply	other threads:[~2019-10-30  7:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30  7:27 Qu Wenruo [this message]
2019-11-01 11:27 ` [PATCH] btrfs-progs: Fix block groups read which may skip certain block groups David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191030072711.73858-1-wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox