summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2018-11-03 16:22:10 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-21 09:27:43 +0100
commit88cc2d51d221bf5bbc3622a47b07ef0947cdbfa1 (patch)
tree6c82b7866568ae7f0e76eaf5c950cdd65dfde614
parent2eefc69471f17b4b65fc8ba8356b9ee3a7c523d0 (diff)
downloadlinux-stable-88cc2d51d221bf5bbc3622a47b07ef0947cdbfa1.tar.gz
linux-stable-88cc2d51d221bf5bbc3622a47b07ef0947cdbfa1.tar.bz2
linux-stable-88cc2d51d221bf5bbc3622a47b07ef0947cdbfa1.zip
ext4: add missing brelse() in set_flexbg_block_bitmap()'s error path
commit cea5794122125bf67559906a0762186cf417099c upstream. Fixes: 33afdcc5402d ("ext4: add a function which sets up group blocks ...") Cc: stable@kernel.org # 3.3 Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/ext4/resize.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 550eb2dfe357..9646d4b325cb 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -442,16 +442,18 @@ static int set_flexbg_block_bitmap(struct super_block *sb, handle_t *handle,
BUFFER_TRACE(bh, "get_write_access");
err = ext4_journal_get_write_access(handle, bh);
- if (err)
+ if (err) {
+ brelse(bh);
return err;
+ }
ext4_debug("mark block bitmap %#04llx (+%llu/%u)\n", block,
block - start, count2);
ext4_set_bits(bh->b_data, block - start, count2);
err = ext4_handle_dirty_metadata(handle, NULL, bh);
+ brelse(bh);
if (unlikely(err))
return err;
- brelse(bh);
}
return 0;