[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1460976397-5688-86-git-send-email-lizf@kernel.org>
Date: Mon, 18 Apr 2016 18:46:31 +0800
From: lizf@...nel.org
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Mike Snitzer <snitzer@...hat.com>,
Zefan Li <lizefan@...wei.com>
Subject: [PATCH 3.4 86/92] dm btree: fix leak of bufio-backed block in btree_split_beneath error path
From: Mike Snitzer <snitzer@...hat.com>
3.4.112-rc1 review patch. If anyone has any objections, please let me know.
------------------
commit 4dcb8b57df3593dcb20481d9d6cf79d1dc1534be upstream.
btree_split_beneath()'s error path had an outstanding FIXME that speaks
directly to the potential for _not_ cleaning up a previously allocated
bufio-backed block.
Fix this by releasing the previously allocated bufio block using
unlock_block().
Reported-by: Mikulas Patocka <mpatocka@...hat.com>
Signed-off-by: Mike Snitzer <snitzer@...hat.com>
Acked-by: Joe Thornber <thornber@...hat.com>
Signed-off-by: Zefan Li <lizefan@...wei.com>
---
drivers/md/persistent-data/dm-btree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c
index dddd5a4..be86d59 100644
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -502,7 +502,7 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key)
r = new_block(s->info, &right);
if (r < 0) {
- /* FIXME: put left */
+ unlock_block(s->info, left);
return r;
}
--
1.9.1
Powered by blists - more mailing lists