linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Liam Howlett <liam.howlett@oracle.com>
To: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Yu Zhao <yuzhao@google.com>
Subject: [PATCH Fix 2/2] test_maple_tree: Add test for spanning store to most of the tree
Date: Wed, 29 Jun 2022 15:23:51 +0000	[thread overview]
Message-ID: <20220629152340.3451959-3-Liam.Howlett@oracle.com> (raw)
In-Reply-To: <20220629152340.3451959-1-Liam.Howlett@oracle.com>

Test spanning almost the entire tree to detect if the root is dead and
the node is placed in the wrong location.

Fixes: 1d3ae73e4e86 (test_maple_tree: Add test for spanning store to most of the tree)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
 lib/test_maple_tree.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c
index 8de5705b7b9b..b028f5648857 100644
--- a/lib/test_maple_tree.c
+++ b/lib/test_maple_tree.c
@@ -35685,7 +35685,6 @@ static noinline void check_spanning_write(struct maple_tree *mt)
 	mas_set(&mas, 1205);
 	MT_BUG_ON(mt, mas_walk(&mas) != NULL);
 	mtree_unlock(mt);
-	mt_dump(mt);
 	mt_validate(mt);
 	mtree_destroy(mt);
 
@@ -35817,6 +35816,15 @@ static noinline void check_spanning_write(struct maple_tree *mt)
 	MT_BUG_ON(mt, mas_walk(&mas) != NULL);
 	mtree_unlock(mt);
 	mtree_destroy(mt);
+
+	mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE);
+	for (i = 0; i <= 100; i++)
+		mtree_test_store_range(mt, i * 10, i * 10 + 5, &i);
+
+	mtree_lock(mt);
+	mas_set_range(&mas, 76, 875);
+	mas_store_gfp(&mas, NULL, GFP_KERNEL);
+	mtree_unlock(mt);
 }
 
 static noinline void check_null_expand(struct maple_tree *mt)
-- 
2.35.1


      parent reply	other threads:[~2022-06-29 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 15:23 [PATCH Fix 0/2] maple_tree: mas_spanning_rebalance() patches Liam Howlett
2022-06-29 15:23 ` [PATCH Fix 1/2] maple_tree: Fix mas_spanning_rebalance() corner case Liam Howlett
2022-06-29 15:23 ` Liam Howlett [this message]

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=20220629152340.3451959-3-Liam.Howlett@oracle.com \
    --to=liam.howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.infradead.org \
    --cc=yuzhao@google.com \
    /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