Skip to content

Commit

Permalink
ext4: add missing brelse() in set_flexbg_block_bitmap()'s error path
Browse files Browse the repository at this point in the history
Fixes: 33afdcc ("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>
  • Loading branch information
Vasily Averin authored and Theodore Ts'o committed Nov 3, 2018
1 parent 9e40289 commit cea5794
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/ext4/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,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",
first_cluster, first_cluster - start, count2);
ext4_set_bits(bh->b_data, first_cluster - start, count2);

err = ext4_handle_dirty_metadata(handle, NULL, bh);
brelse(bh);
if (unlikely(err))
return err;
brelse(bh);
}

return 0;
Expand Down

0 comments on commit cea5794

Please sign in to comment.