* [PATCH 03/44] nfsd41: change check_slot_seqid parameters
@ 2009-06-16 1:19 Benny Halevy
2009-06-16 17:39 ` J. Bruce Fields
0 siblings, 1 reply; 3+ messages in thread
From: Benny Halevy @ 2009-06-16 1:19 UTC (permalink / raw)
To: bfields; +Cc: pnfs, linux-nfs
From: Andy Adamson <andros@netapp.com>
For separation of session slot and clientid slot processing.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfsd/nfs4state.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index d5caf2a..c22ec9b 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1313,26 +1313,26 @@ error:
}
static int
-check_slot_seqid(u32 seqid, struct nfsd4_slot *slot)
+check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse)
{
- dprintk("%s enter. seqid %d slot->sl_seqid %d\n", __func__, seqid,
- slot->sl_seqid);
+ dprintk("%s enter. seqid %d slot_seqid %d\n", __func__, seqid,
+ slot_seqid);
/* The slot is in use, and no response has been sent. */
- if (slot->sl_inuse) {
- if (seqid == slot->sl_seqid)
+ if (slot_inuse) {
+ if (seqid == slot_seqid)
return nfserr_jukebox;
else
return nfserr_seq_misordered;
}
/* Normal */
- if (likely(seqid == slot->sl_seqid + 1))
+ if (likely(seqid == slot_seqid + 1))
return nfs_ok;
/* Replay */
- if (seqid == slot->sl_seqid)
+ if (seqid == slot_seqid)
return nfserr_replay_cache;
/* Wraparound */
- if (seqid == 1 && (slot->sl_seqid + 1) == 0)
+ if (seqid == 1 && (slot_seqid + 1) == 0)
return nfs_ok;
/* Misordered replay or misordered new request */
return nfserr_seq_misordered;
@@ -1355,7 +1355,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
if (conf) {
slot = &conf->cl_slot;
- status = check_slot_seqid(cr_ses->seqid, slot);
+ status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
+ slot->sl_inuse);
if (status == nfserr_replay_cache) {
dprintk("Got a create_session replay! seqid= %d\n",
slot->sl_seqid);
@@ -1380,7 +1381,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
}
slot = &unconf->cl_slot;
- status = check_slot_seqid(cr_ses->seqid, slot);
+ status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
+ slot->sl_inuse);
if (status) {
/* an unconfirmed replay returns misordered */
status = nfserr_seq_misordered;
@@ -1481,7 +1483,7 @@ nfsd4_sequence(struct svc_rqst *rqstp,
slot = &session->se_slots[seq->slotid];
dprintk("%s: slotid %d\n", __func__, seq->slotid);
- status = check_slot_seqid(seq->seqid, slot);
+ status = check_slot_seqid(seq->seqid, slot->sl_seqid, slot->sl_inuse);
if (status == nfserr_replay_cache) {
cstate->slot = slot;
cstate->session = session;
--
1.6.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 03/44] nfsd41: change check_slot_seqid parameters
2009-06-16 1:19 [PATCH 03/44] nfsd41: change check_slot_seqid parameters Benny Halevy
@ 2009-06-16 17:39 ` J. Bruce Fields
2009-06-16 17:40 ` J. Bruce Fields
0 siblings, 1 reply; 3+ messages in thread
From: J. Bruce Fields @ 2009-06-16 17:39 UTC (permalink / raw)
To: Benny Halevy; +Cc: pnfs, linux-nfs
On Tue, Jun 16, 2009 at 04:19:20AM +0300, Benny Halevy wrote:
> From: Andy Adamson <andros@netapp.com>
>
> For separation of session slot and clientid slot processing.
>
> Signed-off-by: Andy Adamson <andros@netapp.com>
> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
This was actually already upstream, just not in my for-2.6.31, because I
based my for-2.6.31 branch off of 2.6.30-rc3, and submitted this to
2.6.30 after -rc3. So my choices included:
- Rebase for-2.6.31 onto a later -rc: but things will go
smoother if I stop rebasing and rewriting my for-xxx branches,
and I've stopped doing that this time around.
- Apply an identical patch to for-2.6.31 at the same time I
submit it upstream: then after I submit for-2.6.31, the
history would end up with two commits each for the same patch.
I don't think that's a serious problem, but it seems ugly.
- Merge upstream back into my for-2.6.31 after submitting
patches: Linus has complained before about people doing this
too much, but I'm assuming doing it in a case like this where
there's a clear reason is OK.
I think option 3 was the right one; so I've done that now and merged
2.6.30 back into for-2.6.31....
Better might have been to merge a for-2.6.30 branch into for-2.6.31.
--b.
> ---
> fs/nfsd/nfs4state.c | 24 +++++++++++++-----------
> 1 files changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index d5caf2a..c22ec9b 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -1313,26 +1313,26 @@ error:
> }
>
> static int
> -check_slot_seqid(u32 seqid, struct nfsd4_slot *slot)
> +check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse)
> {
> - dprintk("%s enter. seqid %d slot->sl_seqid %d\n", __func__, seqid,
> - slot->sl_seqid);
> + dprintk("%s enter. seqid %d slot_seqid %d\n", __func__, seqid,
> + slot_seqid);
>
> /* The slot is in use, and no response has been sent. */
> - if (slot->sl_inuse) {
> - if (seqid == slot->sl_seqid)
> + if (slot_inuse) {
> + if (seqid == slot_seqid)
> return nfserr_jukebox;
> else
> return nfserr_seq_misordered;
> }
> /* Normal */
> - if (likely(seqid == slot->sl_seqid + 1))
> + if (likely(seqid == slot_seqid + 1))
> return nfs_ok;
> /* Replay */
> - if (seqid == slot->sl_seqid)
> + if (seqid == slot_seqid)
> return nfserr_replay_cache;
> /* Wraparound */
> - if (seqid == 1 && (slot->sl_seqid + 1) == 0)
> + if (seqid == 1 && (slot_seqid + 1) == 0)
> return nfs_ok;
> /* Misordered replay or misordered new request */
> return nfserr_seq_misordered;
> @@ -1355,7 +1355,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
>
> if (conf) {
> slot = &conf->cl_slot;
> - status = check_slot_seqid(cr_ses->seqid, slot);
> + status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
> + slot->sl_inuse);
> if (status == nfserr_replay_cache) {
> dprintk("Got a create_session replay! seqid= %d\n",
> slot->sl_seqid);
> @@ -1380,7 +1381,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
> }
>
> slot = &unconf->cl_slot;
> - status = check_slot_seqid(cr_ses->seqid, slot);
> + status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
> + slot->sl_inuse);
> if (status) {
> /* an unconfirmed replay returns misordered */
> status = nfserr_seq_misordered;
> @@ -1481,7 +1483,7 @@ nfsd4_sequence(struct svc_rqst *rqstp,
> slot = &session->se_slots[seq->slotid];
> dprintk("%s: slotid %d\n", __func__, seq->slotid);
>
> - status = check_slot_seqid(seq->seqid, slot);
> + status = check_slot_seqid(seq->seqid, slot->sl_seqid, slot->sl_inuse);
> if (status == nfserr_replay_cache) {
> cstate->slot = slot;
> cstate->session = session;
> --
> 1.6.3
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 03/44] nfsd41: change check_slot_seqid parameters
2009-06-16 17:39 ` J. Bruce Fields
@ 2009-06-16 17:40 ` J. Bruce Fields
0 siblings, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2009-06-16 17:40 UTC (permalink / raw)
To: Benny Halevy; +Cc: pnfs, linux-nfs
On Tue, Jun 16, 2009 at 01:39:51PM -0400, bfields wrote:
> On Tue, Jun 16, 2009 at 04:19:20AM +0300, Benny Halevy wrote:
> > From: Andy Adamson <andros@netapp.com>
> >
> > For separation of session slot and clientid slot processing.
> >
> > Signed-off-by: Andy Adamson <andros@netapp.com>
> > Signed-off-by: Benny Halevy <bhalevy@panasas.com>
>
> This was actually already upstream, just not in my for-2.6.31, because I
> based my for-2.6.31 branch off of 2.6.30-rc3, and submitted this to
> 2.6.30 after -rc3. So my choices included:
>
> - Rebase for-2.6.31 onto a later -rc: but things will go
> smoother if I stop rebasing and rewriting my for-xxx branches,
> and I've stopped doing that this time around.
> - Apply an identical patch to for-2.6.31 at the same time I
> submit it upstream: then after I submit for-2.6.31, the
> history would end up with two commits each for the same patch.
> I don't think that's a serious problem, but it seems ugly.
> - Merge upstream back into my for-2.6.31 after submitting
> patches: Linus has complained before about people doing this
> too much, but I'm assuming doing it in a case like this where
> there's a clear reason is OK.
>
> I think option 3 was the right one; so I've done that now and merged
> 2.6.30 back into for-2.6.31....
>
> Better might have been to merge a for-2.6.30 branch into for-2.6.31.
Um. I meant to respond to 02/44, not 03/44, here!
--b.
>
> --b.
>
> > ---
> > fs/nfsd/nfs4state.c | 24 +++++++++++++-----------
> > 1 files changed, 13 insertions(+), 11 deletions(-)
> >
> > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> > index d5caf2a..c22ec9b 100644
> > --- a/fs/nfsd/nfs4state.c
> > +++ b/fs/nfsd/nfs4state.c
> > @@ -1313,26 +1313,26 @@ error:
> > }
> >
> > static int
> > -check_slot_seqid(u32 seqid, struct nfsd4_slot *slot)
> > +check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse)
> > {
> > - dprintk("%s enter. seqid %d slot->sl_seqid %d\n", __func__, seqid,
> > - slot->sl_seqid);
> > + dprintk("%s enter. seqid %d slot_seqid %d\n", __func__, seqid,
> > + slot_seqid);
> >
> > /* The slot is in use, and no response has been sent. */
> > - if (slot->sl_inuse) {
> > - if (seqid == slot->sl_seqid)
> > + if (slot_inuse) {
> > + if (seqid == slot_seqid)
> > return nfserr_jukebox;
> > else
> > return nfserr_seq_misordered;
> > }
> > /* Normal */
> > - if (likely(seqid == slot->sl_seqid + 1))
> > + if (likely(seqid == slot_seqid + 1))
> > return nfs_ok;
> > /* Replay */
> > - if (seqid == slot->sl_seqid)
> > + if (seqid == slot_seqid)
> > return nfserr_replay_cache;
> > /* Wraparound */
> > - if (seqid == 1 && (slot->sl_seqid + 1) == 0)
> > + if (seqid == 1 && (slot_seqid + 1) == 0)
> > return nfs_ok;
> > /* Misordered replay or misordered new request */
> > return nfserr_seq_misordered;
> > @@ -1355,7 +1355,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
> >
> > if (conf) {
> > slot = &conf->cl_slot;
> > - status = check_slot_seqid(cr_ses->seqid, slot);
> > + status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
> > + slot->sl_inuse);
> > if (status == nfserr_replay_cache) {
> > dprintk("Got a create_session replay! seqid= %d\n",
> > slot->sl_seqid);
> > @@ -1380,7 +1381,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
> > }
> >
> > slot = &unconf->cl_slot;
> > - status = check_slot_seqid(cr_ses->seqid, slot);
> > + status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
> > + slot->sl_inuse);
> > if (status) {
> > /* an unconfirmed replay returns misordered */
> > status = nfserr_seq_misordered;
> > @@ -1481,7 +1483,7 @@ nfsd4_sequence(struct svc_rqst *rqstp,
> > slot = &session->se_slots[seq->slotid];
> > dprintk("%s: slotid %d\n", __func__, seq->slotid);
> >
> > - status = check_slot_seqid(seq->seqid, slot);
> > + status = check_slot_seqid(seq->seqid, slot->sl_seqid, slot->sl_inuse);
> > if (status == nfserr_replay_cache) {
> > cstate->slot = slot;
> > cstate->session = session;
> > --
> > 1.6.3
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-16 17:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-16 1:19 [PATCH 03/44] nfsd41: change check_slot_seqid parameters Benny Halevy
2009-06-16 17:39 ` J. Bruce Fields
2009-06-16 17:40 ` J. Bruce Fields
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox