From: "J. Bruce Fields" <bfields@fieldses.org>
To: Benny Halevy <bhalevy@tonian.com>
Cc: tigran.mkrtchyan@desy.de, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/2] nfsv41: handle current stateid on open and close
Date: Mon, 5 Dec 2011 21:08:51 -0500 [thread overview]
Message-ID: <20111206020851.GA4486@fieldses.org> (raw)
In-Reply-To: <4EDB6AA3.1030702@tonian.com>
On Sun, Dec 04, 2011 at 02:42:11PM +0200, Benny Halevy wrote:
> On 2011-12-04 14:03, tigran.mkrtchyan@desy.de wrote:
> > From: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
> >
> >
> > Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
> > ---
> > fs/nfsd/nfs4proc.c | 6 ++++++
> > fs/nfsd/nfs4state.c | 26 ++++++++++++++++++++------
> > 2 files changed, 26 insertions(+), 6 deletions(-)
> >
> > diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> > index fa38336..535aed2 100644
> > --- a/fs/nfsd/nfs4proc.c
> > +++ b/fs/nfsd/nfs4proc.c
> > @@ -400,6 +400,12 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> > */
> > status = nfsd4_process_open2(rqstp, &cstate->current_fh, open);
> > WARN_ON(status && open->op_created);
> > +
> > + if(status)
> > + goto out;
> > +
> > + /* set current state id */
> > + memcpy(&cstate->current_stateid, &open->op_stateid, sizeof(stateid_t));
That comment is a bit redundant.
> Since this should be done for all stateid-returning operations
> I think that a cleaner approach could be to mark those as such in
> nfsd4_ops by providing a per-op function to return the operation's
> stateid. You can then call this method from nfsd4_proc_compound()
> after the call to nfsd4_encode_operation() and when status == 0.
So the choice is between
+ memcpy(&cstate->current_stateid, &open->op_stateid,
sizeof(stateid_t));
and
+ static void get_open_stateid(stateid_t *s)
+ {
+ memcpy(s, open->op_stateid);
+ }
+
+ [OP_OPEN] = {
+ ...
+ .op_get_stateid = get_open_stateid,
+ ...
+ }
?
I'm not so sure.
Anyway, thanks Tigran for looking at this.
Do we want to guarantee that the client can't expire as long as a
compound references the stateid? I think that's the case.
--b.
next prev parent reply other threads:[~2011-12-06 2:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-04 12:03 nfsv41: add current_stateid processing tigran.mkrtchyan
2011-12-04 12:03 ` [PATCH 1/2] nfsv41: add current stateid into compound_state tigran.mkrtchyan
2011-12-04 12:25 ` Benny Halevy
2011-12-04 12:03 ` [PATCH 2/2] nfsv41: handle current stateid on open and close tigran.mkrtchyan
2011-12-04 12:42 ` Benny Halevy
2011-12-04 13:53 ` Tigran Mkrtchyan
2011-12-06 2:08 ` J. Bruce Fields [this message]
2011-12-06 11:26 ` Benny Halevy
2011-12-06 12:40 ` J. Bruce Fields
2011-12-06 14:30 ` Benny Halevy
2011-12-06 19:10 ` J. Bruce Fields
2011-12-06 21:47 ` Tigran Mkrtchyan
2011-12-07 14:15 ` Benny Halevy
2011-12-06 13:31 ` Tigran Mkrtchyan
2011-12-06 13:40 ` J. Bruce Fields
2011-12-06 14:32 ` Benny Halevy
2011-12-06 18:24 ` Tigran Mkrtchyan
2011-12-07 14:17 ` Benny Halevy
2011-12-04 12:48 ` nfsv41: add current_stateid processing Benny Halevy
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=20111206020851.GA4486@fieldses.org \
--to=bfields@fieldses.org \
--cc=bhalevy@tonian.com \
--cc=linux-nfs@vger.kernel.org \
--cc=tigran.mkrtchyan@desy.de \
/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;
as well as URLs for NNTP newsgroup(s).