[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a66aeebab32520ea1f2ad6eced6bb8b5956ffbf2.camel@kernel.org>
Date: Mon, 18 Mar 2024 06:21:23 -0400
From: Jeff Layton <jlayton@...nel.org>
To: Stefan Metzmacher <metze@...ba.org>, Alexander Viro
<viro@...iv.linux.org.uk>, 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>
Cc: 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 06/24] vfs: break parent dir delegations in
open(..., O_CREAT) codepath
On Mon, 2024-03-18 at 09:25 +0100, Stefan Metzmacher wrote:
> Hi Jeff,
>
> > In order to add directory delegation support, we need to break
> > delegations on the parent whenever there is going to be a change in the
> > directory.
> >
> > Add a delegated_inode parameter to lookup_open and have it break the
> > delegation. Then, open_last_lookups can wait for the delegation break
> > and retry the call to lookup_open once it's done.
> >
> > Signed-off-by: Jeff Layton <jlayton@...nel.org>
> > ---
> > fs/namei.c | 22 ++++++++++++++++++----
> > 1 file changed, 18 insertions(+), 4 deletions(-)
> >
> > diff --git a/fs/namei.c b/fs/namei.c
> > index f00d8d708001..88598a62ec64 100644
> > --- a/fs/namei.c
> > +++ b/fs/namei.c
> > @@ -3404,7 +3404,7 @@ static struct dentry *atomic_open(struct nameidata *nd, struct dentry *dentry,
> > */
> > static struct dentry *lookup_open(struct nameidata *nd, struct file *file,
> > const struct open_flags *op,
> > - bool got_write)
> > + bool got_write, struct inode **delegated_inode)
>
> Does NFS has a concept of lease keys and parent lease keys?
>
> In SMB it's possible that the client passes a lease key (16 client chosen bytes) to a directory open,
> when asking for a directory lease.
>
> Then operations on files within that directory, take that lease key from the directory as
> 'parent lease keys' in addition to a unique lease key for the file.
>
> That way a client can avoid breaking its own directory leases when creating/move/delete... files
> in the directory.
>
No, it's a bit different with NFSv4 directory delegations. A delegation
is given vs a filehandle (which is analogous to an inode), and it gets a
stateid, which just uniquely identifies it. There is no real association
with the parent.
When you request the dir delegation, you can request to be notified when
something changes instead of the server recalling it. The server may or
may not grant that request. Notifications are not implemented in this
patchset as of yet. I'm focusing on getting the recall handling right
first, and then I'll plan to add that in a later phase.
--
Jeff Layton <jlayton@...nel.org>
Powered by blists - more mailing lists