[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241206155146.wmc2flrony62d524@quack3>
Date: Fri, 6 Dec 2024 16:51:46 +0100
From: Jan Kara <jack@...e.cz>
To: Zhang Yi <yi.zhang@...weicloud.com>
Cc: Jan Kara <jack@...e.cz>, linux-ext4@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
tytso@....edu, adilger.kernel@...ger.ca, ritesh.list@...il.com,
hch@...radead.org, djwong@...nel.org, david@...morbit.com,
zokeefe@...gle.com, yi.zhang@...wei.com, chengzhihao1@...wei.com,
yukuai3@...wei.com, yangerkun@...wei.com
Subject: Re: [PATCH 09/27] ext4: move out inode_lock into ext4_fallocate()
On Fri 06-12-24 16:13:14, Zhang Yi wrote:
> On 2024/12/4 20:05, Jan Kara wrote:
> > On Tue 22-10-24 19:10:40, Zhang Yi wrote:
> >> From: Zhang Yi <yi.zhang@...wei.com>
> >>
> >> Currently, all five sub-functions of ext4_fallocate() acquire the
> >> inode's i_rwsem at the beginning and release it before exiting. This
> >> process can be simplified by factoring out the management of i_rwsem
> >> into the ext4_fallocate() function.
> >>
> >> Signed-off-by: Zhang Yi <yi.zhang@...wei.com>
> >
> > Ah, nice. Feel free to add:
> >
> > Reviewed-by: Jan Kara <jack@...e.cz>
> >
> > and please ignore my comments about renaming 'out' labels :).
> >
> > Honza
> >
>
> ...
>
> >> @@ -4774,9 +4765,8 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
> >>
> >> inode_lock(inode);
> >> ret = ext4_convert_inline_data(inode);
> >> - inode_unlock(inode);
> >> if (ret)
> >> - return ret;
> >> + goto out;
> >>
> >> if (mode & FALLOC_FL_PUNCH_HOLE)
> >> ret = ext4_punch_hole(file, offset, len);
> >> @@ -4788,7 +4778,8 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
> >> ret = ext4_zero_range(file, offset, len, mode);
> >> else
> >> ret = ext4_do_fallocate(file, offset, len, mode);
> >> -
> >> +out:
> >> + inode_unlock(inode);
> >> return ret;
> >> }
> >>
>
> I guess you may want to suggest rename this out to out_inode_lock as well.
Right. This one should better be out_inode_lock.
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists