Skip to content

Commit

Permalink
dm btree: fix leak of bufio-backed block in btree_split_beneath error…
Browse files Browse the repository at this point in the history
… path

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>
Cc: stable@vger.kernel.org
  • Loading branch information
snitm committed Oct 23, 2015
1 parent 2871c69 commit 4dcb8b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/persistent-data/dm-btree.c
Expand Up @@ -523,7 +523,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;
}

Expand Down

0 comments on commit 4dcb8b5

Please sign in to comment.