DM-Devel Archive mirror
 help / color / mirror / Atom feed
* [dm-devel] [PATCH -next] dm btree: shadow_child leaves unchecked in split_two_into_three
@ 2021-06-01 10:02 Tong Tiangen
  0 siblings, 0 replies; only message in thread
From: Tong Tiangen @ 2021-06-01 10:02 UTC (permalink / raw
  To: Alasdair Kergon, Mike Snitzer, dm-devel; +Cc: Tong Tiangen, linux-kernel

Function shadow_child() leaves variable 'r' unchecked in
split_two_into_three when parent_index not equals to 0.
It's also not coordinate with above relative codes.

Fixes: dee29bf9192b ("dm btree: improve btree residency")
Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
---
 drivers/md/persistent-data/dm-btree.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c
index 3e5a90580427..0703ca7a7d9a 100644
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -743,8 +743,10 @@ static int split_two_into_three(struct shadow_spine *s, unsigned parent_index,
 			return r;
 	} else {
 		middle_index = parent_index;
-		r = shadow_child(s->info, vt, pn, parent_index - 1, &left);
 		right = shadow_current(s);
+		r = shadow_child(s->info, vt, pn, parent_index - 1, &left);
+		if (r)
+			return r;
 	}
 
 	r = new_block(s->info, &middle);
-- 
2.18.0.huawei.25


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-02  8:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-01 10:02 [dm-devel] [PATCH -next] dm btree: shadow_child leaves unchecked in split_two_into_three Tong Tiangen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).