lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ww5fcxuzfcgttglsr6cpnrxufeusw4ixe76iqp7mab3djlyfje@zozue6qvxhzy>
Date: Mon, 29 Apr 2024 23:31:21 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Youling Tang <youling.tang@...ux.dev>
Cc: linux-bcachefs@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Youling Tang <tangyouling@...inos.cn>
Subject: Re: [PATCH] bcachefs: Fix error path of bch2_link_trans()

On Tue, Apr 30, 2024 at 11:28:39AM +0800, Youling Tang wrote:
> From: Youling Tang <tangyouling@...inos.cn>
> 
> In bch2_link_trans(), if bch2_inode_nlink_inc() fails, it needs to
> call bch2_trans_iter_exit() in the error path.

Thanks - applied.
> 
> Signed-off-by: Youling Tang <tangyouling@...inos.cn>
> ---
>  fs/bcachefs/fs-common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/bcachefs/fs-common.c b/fs/bcachefs/fs-common.c
> index 6c737def357e..508d029ac53d 100644
> --- a/fs/bcachefs/fs-common.c
> +++ b/fs/bcachefs/fs-common.c
> @@ -200,12 +200,12 @@ int bch2_link_trans(struct btree_trans *trans,
>  
>  	ret = bch2_inode_peek(trans, &inode_iter, inode_u, inum, BTREE_ITER_intent);
>  	if (ret)
> -		goto err;
> +		return ret;
>  
>  	inode_u->bi_ctime = now;
>  	ret = bch2_inode_nlink_inc(inode_u);
>  	if (ret)
> -		return ret;
> +		goto err;
>  
>  	ret = bch2_inode_peek(trans, &dir_iter, dir_u, dir, BTREE_ITER_intent);
>  	if (ret)
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ