All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Subject: [PATCH RESEND 3/4] btrfs-progs: lowmem check: Fix false alert about referencer count mismatch
Date: Fri, 3 Nov 2017 16:28:05 +0800	[thread overview]
Message-ID: <20171103082806.22448-4-lufq.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <20171103082806.22448-1-lufq.fnst@cn.fujitsu.com>

The normal back reference counting doesn't care about the extent referred
by the extent data in the shared leaf. The check_extent_data_backref
function need to skip the leaf that owner mismatch with the root_id.

Reported-by: Marc MERLIN <marc@merlins.org>
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
---
 cmds-check.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmds-check.c b/cmds-check.c
index 5750bb72..a93ac2c8 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -12468,7 +12468,8 @@ static int check_extent_data_backref(struct btrfs_fs_info *fs_info,
 		leaf = path.nodes[0];
 		slot = path.slots[0];
 
-		if (slot >= btrfs_header_nritems(leaf))
+		if (slot >= btrfs_header_nritems(leaf) ||
+		    btrfs_header_owner(leaf) != root_id)
 			goto next;
 		btrfs_item_key_to_cpu(leaf, &key, slot);
 		if (key.objectid != objectid || key.type != BTRFS_EXTENT_DATA_KEY)
-- 
2.15.0




  parent reply	other threads:[~2017-11-03  8:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03  8:28 [PATCH RESEND 0/4] fix alert and add testcase lowmem check Lu Fengqi
2017-11-03  8:28 ` [PATCH RESEND 1/4] btrfs-progs: test: Add test image for lowmem mode file extent interrupt Lu Fengqi
2017-11-03  8:28 ` [PATCH RESEND 2/4] btrfs-progs: lowmem check: Output more detailed information about " Lu Fengqi
2017-11-03  8:28 ` Lu Fengqi [this message]
2017-11-03  8:28 ` [PATCH RESEND 4/4] btrfs-progs: test: Add test image for lowmem mode referencer count mismatch false alert Lu Fengqi
2017-11-09 16:23 ` [PATCH RESEND 0/4] fix alert and add testcase lowmem check David Sterba
2017-11-09 16:25   ` 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=20171103082806.22448-4-lufq.fnst@cn.fujitsu.com \
    --to=lufq.fnst@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.