Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 3/3] Make max_size consistent with nr
@ 2017-04-28  9:13 Christophe de Dinechin
  2017-04-28  9:16 ` Roman Mamedov
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe de Dinechin @ 2017-04-28  9:13 UTC (permalink / raw)
  To: Btrfs BTRFS

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 58e65d6..774e9b6 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


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

end of thread, other threads:[~2017-05-02 16:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [PATCH 3/3 v2] Make max_size consistent with nr Christophe de Dinechin
2017-05-02 16:53     ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox