Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Sagi Grimberg <sagi@grimberg.me>, Olga Kornievskaia <aglo@umich.edu>
Cc: Chuck Lever <chuck.lever@oracle.com>,
	Dai Ngo <dai.ngo@oracle.com>,
	 linux-nfs@vger.kernel.org
Subject: Re: [PATCH rfc 2/2] NFSD: allow client to use write delegation stateid for READ
Date: Fri, 26 Jul 2024 10:00:47 -0400	[thread overview]
Message-ID: <3128788be5ddbd9ae858ea5dbf8254ad663a4d37.camel@kernel.org> (raw)
In-Reply-To: <683439e6-3251-4ffa-bac1-21343e05db4e@grimberg.me>

On Wed, 2024-07-24 at 14:47 -0700, Sagi Grimberg wrote:
> 
> 
> 
> On 24/07/2024 22:29, Olga Kornievskaia wrote:
> > On Wed, Jul 24, 2024 at 1:01 PM Sagi Grimberg <sagi@grimberg.me>
> > wrote:
> > > Based on a patch fom Dai Ngo, allow NFSv4 client to use write
> > > delegation
> > > stateid for READ operation. Per RFC 8881 section 9.1.2. Use of
> > > the
> > > Stateid and Locking.
> > > 
> > > In addition, for anonymous stateids, check for pending
> > > delegations by
> > > the filehandle and client_id, and if a conflict found, recall the
> > > delegation
> > > before allowing the read to take place.
> > > 
> > > Suggested-by: Dai Ngo <dai.ngo@oracle.com>
> > > Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> > > ---
> > >   fs/nfsd/nfs4proc.c  | 22 +++++++++++++++++++--
> > >   fs/nfsd/nfs4state.c | 47
> > > +++++++++++++++++++++++++++++++++++++++++++++
> > >   fs/nfsd/nfs4xdr.c   |  9 +++++++++
> > >   fs/nfsd/state.h     |  2 ++
> > >   fs/nfsd/xdr4.h      |  2 ++
> > >   5 files changed, 80 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> > > index 7b70309ad8fb..324984ec70c6 100644
> > > --- a/fs/nfsd/nfs4proc.c
> > > +++ b/fs/nfsd/nfs4proc.c
> > > @@ -979,8 +979,24 @@ nfsd4_read(struct svc_rqst *rqstp, struct
> > > nfsd4_compound_state *cstate,
> > >          /* check stateid */
> > >          status = nfs4_preprocess_stateid_op(rqstp, cstate,
> > > &cstate->current_fh,
> > >                                          &read->rd_stateid,
> > > RD_STATE,
> > > -                                       &read->rd_nf, NULL);
> > > -
> > > +                                       &read->rd_nf, &read-
> > > >rd_wd_stid);
> > Now I can see that this patch wants to leverage the "returned
> > stateid
> > of the nfs4_preprocess_stateid_op() but the logic in the previous
> > patch was in the way because it distinguished the copy_notify by
> > the
> > non-null passed in stateid. So I would suggest that in order to not
> > break the copy_notify and help with this functionality something
> > else
> > is sent into nfs4_proprocess_staetid_op() to allow for the stateid
> > to
> > be passed and then distinguish between copy_notify and read.
> 
> My thinking is that instead having the generic stateid pre-processing
> be aware which proc may accept a special stateid and which may not,
> we'd want to have the call-sites enforce that...
> 
> But I am not the expert here, and will be happy to change based on
> your preference...

I tend to agree with Sagi here. Keeping this sort of operation-specific
check in the operation-specific function makes more sense to me too.
-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2024-07-26 14:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 17:01 [PATCH rfc 1/2] nfsd: don't assume copy notify when preprocessing the stateid Sagi Grimberg
2024-07-24 17:01 ` [PATCH rfc 2/2] NFSD: allow client to use write delegation stateid for READ Sagi Grimberg
2024-07-24 19:29   ` Olga Kornievskaia
2024-07-24 21:47     ` Sagi Grimberg
2024-07-26 14:00       ` Jeff Layton [this message]
2024-07-26 13:54   ` Jeff Layton
2024-07-26 14:49     ` Jeff Layton
2024-07-26 14:06   ` Chuck Lever
2024-07-27 17:00     ` Dai Ngo
2024-07-27 19:22       ` Sagi Grimberg
2024-07-27 19:26     ` Sagi Grimberg
2024-07-27 19:53       ` Chuck Lever
2024-07-27 19:58         ` Chuck Lever
2024-07-27 16:46   ` Dai Ngo
2024-07-27 16:52     ` Chuck Lever
2024-07-27 18:55       ` Dai Ngo
2024-07-27 19:33         ` Sagi Grimberg
2024-07-27 22:13           ` Dai Ngo
2024-07-27 19:28       ` Sagi Grimberg
2024-07-24 17:06 ` [PATCH rfc 1/2] nfsd: don't assume copy notify when preprocessing the stateid Chuck Lever
2024-07-24 19:12   ` Olga Kornievskaia
2024-07-24 21:43     ` Sagi Grimberg
2024-07-25 13:51       ` Olga Kornievskaia
2024-07-26 13:47         ` Chuck Lever
2024-07-26 14:07           ` Olga Kornievskaia
2024-07-26 13:23 ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3128788be5ddbd9ae858ea5dbf8254ad663a4d37.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=aglo@umich.edu \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox