aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDinghao Liu <[email protected]>2020-08-29 10:54:02 +0800
committerTheodore Ts'o <[email protected]>2020-10-18 10:36:14 -0400
commitc9e87161cc621cbdcfc472fa0b2d81c63780c8f5 (patch)
treeb4e05cb96ba9b476d44de577d6550a010f013040
parentaa2f77920b743c44e02e2dc8474bbf8bd30007a2 (diff)
ext4: fix error handling code in add_new_gdb
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: [email protected] Signed-off-by: Dinghao Liu <[email protected]> Reviewed-by: Andreas Dilger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
-rw-r--r--fs/ext4/resize.c4
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);