diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-08-29 10:54:02 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-11-05 11:51:51 +0100 |
commit | 9129151073eb09a20710387f0ed3e13fe3508c11 (patch) | |
tree | d4150e2fdc66d8af022af263fe8923fe66947860 | |
parent | 5802528b2fc14e6cfd767f32c119b8897f6be1fe (diff) | |
download | linux-stable-9129151073eb09a20710387f0ed3e13fe3508c11.tar.gz linux-stable-9129151073eb09a20710387f0ed3e13fe3508c11.tar.bz2 linux-stable-9129151073eb09a20710387f0ed3e13fe3508c11.zip |
ext4: fix error handling code in add_new_gdb
commit c9e87161cc621cbdcfc472fa0b2d81c63780c8f5 upstream.
When ext4_journal_get_write_access() fails, we should
terminate the execution flow and release n_group_desc,
iloc.bh, dind and gdb_bh.
Cc: stable@kernel.org
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20200829025403.3139-1-dinghao.liu@zju.edu.cn
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/ext4/resize.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index a50b51270ea9..71bf600e5b42 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -843,8 +843,10 @@ static int add_new_gdb(handle_t *handle, struct inode *inode, BUFFER_TRACE(dind, "get_write_access"); err = ext4_journal_get_write_access(handle, dind); - if (unlikely(err)) + if (unlikely(err)) { ext4_std_error(sb, err); + goto errout; + } /* ext4_reserve_inode_write() gets a reference on the iloc */ err = ext4_reserve_inode_write(handle, inode, &iloc); |