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: <20240729112802.eqkmgf66ebnc22u5@quack3>
Date: Mon, 29 Jul 2024 13:28:02 +0200
From: Jan Kara <jack@...e.cz>
To: Baokun Li <libaokun@...weicloud.com>
Cc: Jan Kara <jack@...e.cz>, linux-ext4@...r.kernel.org, tytso@....edu,
	adilger.kernel@...ger.ca, ritesh.list@...il.com,
	linux-kernel@...r.kernel.org, yi.zhang@...wei.com,
	yangerkun@...wei.com, Baokun Li <libaokun1@...wei.com>
Subject: Re: [PATCH 08/20] ext4: get rid of ppath in ext4_find_extent()

On Sat 27-07-24 14:18:33, Baokun Li wrote:
> On 2024/7/25 18:38, Jan Kara wrote:
> > On Wed 10-07-24 12:06:42, libaokun@...weicloud.com wrote:
> > > From: Baokun Li <libaokun1@...wei.com>
> > > 
> > > The use of path and ppath is now very confusing, so to make the code more
> > > readable, pass path between functions uniformly, and get rid of ppath.
> > > 
> > > Getting rid of ppath in ext4_find_extent() requires its caller to update
> > > ppath. These ppaths will also be dropped later. No functional changes.
> > > 
> > > Signed-off-by: Baokun Li <libaokun1@...wei.com>
> > One nit below, otherwise feel free to add:
> > 
> > Reviewed-by: Jan Kara <jack@...e.cz>
> > 
> > > @@ -3260,11 +3257,12 @@ static int ext4_split_extent_at(handle_t *handle,
> > >   	 * WARN_ON may be triggered in ext4_da_update_reserve_space() due to
> > >   	 * an incorrect ee_len causing the i_reserved_data_blocks exception.
> > >   	 */
> > > -	path = ext4_find_extent(inode, ee_block, ppath,
> > > +	path = ext4_find_extent(inode, ee_block, *ppath,
> > >   				flags | EXT4_EX_NOFAIL);
> > >   	if (IS_ERR(path)) {
> > >   		EXT4_ERROR_INODE(inode, "Failed split extent on %u, err %ld",
> > >   				 split, PTR_ERR(path));
> > > +		*ppath = NULL;
> > >   		return PTR_ERR(path);
> > >   	}
> > I think here you forgot to update ppath on success case. It will go away by
> > the end of the series but still it's good to keep thing consistent...
> > 
> > 								Honza
> 
> Hi Honza,
> 
> Thank you for your review!
> 
> In patch 5, the ppath is already updated in case of success, so there
> is no need to add it here. This update was not shown when the patch
> was made and it looks like this:
> 
> -       path = ext4_find_extent(inode, ee_block, ppath,
> +       path = ext4_find_extent(inode, ee_block, *ppath,
>                                 flags | EXT4_EX_NOFAIL);
>         if (IS_ERR(path)) {
>                 EXT4_ERROR_INODE(inode, "Failed split extent on %u, err
> %ld",
>                                  split, PTR_ERR(path));
> +               *ppath = NULL;
>                 return PTR_ERR(path);
>         }
>         depth = ext_depth(inode);
>         ex = path[depth].p_ext;
>         *ppath = path;

Yes, you are right. I didn't realize the update was already there. So I
withdraw my comment :)

								Honza

-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ