[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a635d0fc7d43bc10ed486efcae627f278e0df328.camel@kernel.org>
Date: Sun, 17 Mar 2024 10:09:51 -0400
From: Jeff Layton <jlayton@...nel.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>, Chuck
Lever <chuck.lever@...cle.com>, Alexander Aring <alex.aring@...il.com>,
Trond Myklebust <trond.myklebust@...merspace.com>, Anna Schumaker
<anna@...nel.org>, Steve French <sfrench@...ba.org>, Paulo Alcantara
<pc@...guebit.com>, Ronnie Sahlberg <ronniesahlberg@...il.com>, Shyam
Prasad N <sprasad@...rosoft.com>, Tom Talpey <tom@...pey.com>, Greg
Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki"
<rafael@...nel.org>, David Howells <dhowells@...hat.com>, Tyler Hicks
<code@...icks.com>, Neil Brown <neilb@...e.de>, Olga Kornievskaia
<kolga@...app.com>, Dai Ngo <Dai.Ngo@...cle.com>, Miklos Szeredi
<miklos@...redi.hu>, Amir Goldstein <amir73il@...il.com>, Namjae Jeon
<linkinjeon@...nel.org>, Sergey Senozhatsky <senozhatsky@...omium.org>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-nfs@...r.kernel.org,
linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
netfs@...ts.linux.dev, ecryptfs@...r.kernel.org,
linux-unionfs@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH RFC 03/24] vfs: add try_break_deleg calls for parents to
vfs_{link,rename,unlink}
On Sat, 2024-03-16 at 23:57 +0000, Al Viro wrote:
> On Fri, Mar 15, 2024 at 12:52:54PM -0400, Jeff Layton wrote:
> > @@ -4603,9 +4606,12 @@ int vfs_link(struct dentry *old_dentry, struct mnt_idmap *idmap,
> > else if (max_links && inode->i_nlink >= max_links)
> > error = -EMLINK;
> > else {
> > - error = try_break_deleg(inode, delegated_inode);
> > - if (!error)
> > - error = dir->i_op->link(old_dentry, dir, new_dentry);
> > + error = try_break_deleg(dir, delegated_inode);
> > + if (!error) {
> > + error = try_break_deleg(inode, delegated_inode);
> > + if (!error)
> > + error = dir->i_op->link(old_dentry, dir, new_dentry);
> > + }
>
> A minor nit: that might be easier to follow as
> error = try_break_deleg(dir, delegated_inode);
> if (!error)
> error = try_break_deleg(inode, delegated_inode);
> if (!error)
> error = dir->i_op->link(old_dentry, dir, new_dentry);
>
> and let the compiler deal with optimizing it - any C compiler is going to be
> able to figure out that one out. vfs_link() is a mix of those styles anyway -
> we have
> if (!error && (inode->i_state & I_LINKABLE)) {
> spin_lock(&inode->i_lock);
> inode->i_state &= ~I_LINKABLE;
> spin_unlock(&inode->i_lock);
> }
> immediately afterwards; might as well make that consistent, especially since
> you are getting more shallow nesting that way.
Sounds good. Fixed in my tree.
Thanks for the review so far!
--
Jeff Layton <jlayton@...nel.org>
Powered by blists - more mailing lists