ext4: avoid possible double brelse() in add_new_gdb() on error path
authorTheodore Ts'o <tytso@mit.edu>
Tue, 6 Nov 2018 22:18:17 +0000 (17:18 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 6 Nov 2018 22:18:17 +0000 (17:18 -0500)
Fixes: b40971426a83 ("ext4: add error checking to calls to ...")
Reported-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org # 2.6.38
fs/ext4/resize.c

index 85158e9de7c233e0217743e01904ca5a12858097..a5efee34415fe5a6560522f5b3c48b08c3aac0d8 100644 (file)
@@ -871,6 +871,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
        err = ext4_handle_dirty_metadata(handle, NULL, gdb_bh);
        if (unlikely(err)) {
                ext4_std_error(sb, err);
+               iloc.bh = NULL;
                goto exit_inode;
        }
        brelse(dind);