diff options
author | Mike Snitzer <snitzer@redhat.com> | 2015-10-22 10:56:40 -0400 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2016-04-27 18:55:29 +0800 |
commit | ede7386c3e8605a23c9ea89530894ce074397aa6 (patch) | |
tree | c6b57e8666c8462cddf86ef2b7e8486b8a10e0ea | |
parent | e2c8a2c8819e0840e85aee5132f0925f92c047c8 (diff) |
dm btree: fix leak of bufio-backed block in btree_split_beneath error path
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@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <thornber@redhat.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
-rw-r--r-- | drivers/md/persistent-data/dm-btree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index dddd5a47f97d..be86d59eaa90 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; } |