diff options
author | Mike Snitzer <snitzer@redhat.com> | 2015-10-22 10:56:40 -0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2015-11-17 15:54:45 +0000 |
commit | 12d1c67b7b482bea0503fb9e42e9d257498b5c32 (patch) | |
tree | edbba7d62eec0a797184cfe5569f327c63c2c24e | |
parent | 11020754df47e783aa3908c2fbf33318b05b744e (diff) | |
download | lwn-12d1c67b7b482bea0503fb9e42e9d257498b5c32.tar.gz lwn-12d1c67b7b482bea0503fb9e42e9d257498b5c32.zip |
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: Ben Hutchings <ben@decadent.org.uk>
-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 62f297a44dd5..29e423f6bfa5 100644 --- a/drivers/md/persistent-data/dm-btree.c +++ b/drivers/md/persistent-data/dm-btree.c @@ -503,7 +503,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; } |