[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9EDDAFAC-52D2-4FE3-958C-5F57DD0792C0@dilger.ca>
Date: Sat, 29 Aug 2020 01:21:46 -0600
From: Andreas Dilger <adilger@...ger.ca>
To: Dinghao Liu <dinghao.liu@....edu.cn>
Cc: kjlu@....edu, Theodore Ts'o <tytso@....edu>,
Ext4 Developers List <linux-ext4@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] [v2] ext4: Fix error handling code in add_new_gdb
On Aug 28, 2020, at 8:54 PM, Dinghao Liu <dinghao.liu@....edu.cn> wrote:
>
> When ext4_journal_get_write_access() fails, we should
> terminate the execution flow and release n_group_desc,
> iloc.bh, dind and gdb_bh.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
Looks good. I also reviewed the other error conditions in this function
and didn't see any similar problems.
Reviewed-by: Andreas Dilger <adilger@...ger.ca>
> ---
>
> Changelog:
>
> v2: - Remove changes to ext4_handle_dirty_super()'s
> error handling path.
> ---
> fs/ext4/resize.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> 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);
> --
> 2.17.1
>
Cheers, Andreas
Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)
Powered by blists - more mailing lists