This is a note to let you know that I've just added the patch titled ext4: add missing brelse() in set_flexbg_block_bitmap()'s error path to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ext4-add-missing-brelse-in-set_flexbg_block_bitmap-s-error-path.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From cea5794122125bf67559906a0762186cf417099c Mon Sep 17 00:00:00 2001 From: Vasily Averin <vvs@xxxxxxxxxxxxx> Date: Sat, 3 Nov 2018 16:22:10 -0400 Subject: ext4: add missing brelse() in set_flexbg_block_bitmap()'s error path From: Vasily Averin <vvs@xxxxxxxxxxxxx> commit cea5794122125bf67559906a0762186cf417099c upstream. Fixes: 33afdcc5402d ("ext4: add a function which sets up group blocks ...") Cc: stable@xxxxxxxxxx # 3.3 Signed-off-by: Vasily Averin <vvs@xxxxxxxxxxxxx> Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ext4/resize.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -459,16 +459,18 @@ static int set_flexbg_block_bitmap(struc 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; Patches currently in stable-queue which might be from vvs@xxxxxxxxxxxxx are queue-4.19/ext4-fix-buffer-leak-in-ext4_expand_extra_isize_ea-on-error-path.patch queue-4.19/ext4-add-missing-brelse-add_new_gdb_meta_bg-s-error-path.patch queue-4.19/mm-swapfile.c-use-kvzalloc-for-swap_info_struct-allocation.patch queue-4.19/ext4-avoid-buffer-leak-in-ext4_orphan_add-after-prior-errors.patch queue-4.19/ext4-missing-bh-check-in-ext4_xattr_inode_write.patch queue-4.19/ext4-avoid-buffer-leak-on-shutdown-in-ext4_mark_iloc_dirty.patch queue-4.19/ext4-release-bs.bh-before-re-using-in-ext4_xattr_block_find.patch queue-4.19/ext4-fix-missing-cleanup-if-ext4_alloc_flex_bg_array-fails-while-resizing.patch queue-4.19/ext4-fix-buffer-leak-in-__ext4_read_dirblock-on-error-path.patch queue-4.19/ext4-fix-possible-inode-leak-in-the-retry-loop-of-ext4_resize_fs.patch queue-4.19/ext4-fix-buffer-leak-in-ext4_xattr_get_block-on-error-path.patch queue-4.19/ext4-fix-possible-leak-of-sbi-s_group_desc_leak-in-error-path.patch queue-4.19/ext4-add-missing-brelse-in-set_flexbg_block_bitmap-s-error-path.patch queue-4.19/ext4-fix-buffer-leak-in-ext4_xattr_move_to_block-on-error-path.patch queue-4.19/ext4-avoid-potential-extra-brelse-in-setup_new_flex_group_blocks.patch queue-4.19/ext4-add-missing-brelse-update_backups-s-error-path.patch queue-4.19/ext4-avoid-possible-double-brelse-in-add_new_gdb-on-error-path.patch queue-4.19/ext4-fix-possible-leak-of-s_journal_flag_rwsem-in-error-path.patch