All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe de Dinechin <dinechin@redhat.com>
To: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Cc: Roman Mamedov <rm@romanrm.net>
Subject: [PATCH 3/3 v2] Make max_size consistent with nr
Date: Fri, 28 Apr 2017 11:51:21 +0200	[thread overview]
Message-ID: <B8A1E13A-A60F-428D-AA1F-71890BD758EE@redhat.com> (raw)
In-Reply-To: <20170428141640.12429352@natsu>

Since we memset tmpl, max_size==0. This does not seem consistent with nr = 1.
In check_extent_refs, we will call:

  set_extent_dirty(root->fs_info->excluded_extents,
                   rec->start,
                   rec->start + rec->max_size - 1);

This ends up with BUG_ON(end < start) in insert_state.

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
---
 cmds-check.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cmds-check.c b/cmds-check.c
index c13f900..d5e2966 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -6193,6 +6193,7 @@ static int add_tree_backref(struct cache_tree *extent_cache, u64 bytenr,
 		tmpl.start = bytenr;
 		tmpl.nr = 1;
 		tmpl.metadata = 1;
+		tmpl.max_size = 1;
 
 		ret = add_extent_rec_nolookup(extent_cache, &tmpl);
 		if (ret)
-- 
2.9.3


  parent reply	other threads:[~2017-04-28  9:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28  9:13 [PATCH 3/3] Make max_size consistent with nr Christophe de Dinechin
2017-04-28  9:16 ` Roman Mamedov
2017-04-28  9:50   ` [PATCH 2/3 v2] Prevent attempt to insert extent record with max_size==0 Christophe de Dinechin
2017-05-02 16:46     ` David Sterba
2017-04-28  9:51   ` Christophe de Dinechin [this message]
2017-05-02 16:53     ` [PATCH 3/3 v2] Make max_size consistent with nr 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=B8A1E13A-A60F-428D-AA1F-71890BD758EE@redhat.com \
    --to=dinechin@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rm@romanrm.net \
    /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.