2011-11-04 14:29:19

by Andy Adamson

[permalink] [raw]
Subject: [PATCH (resend) Version 2 3/3] NFSv4.1: fix backchennel bug

From: Andy Adamson <[email protected]>

Slotid's start from 0 which means we check against
NFS41_BC_MAX_CALLBACKS - 1.

Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/callback_proc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 98ff5fc..12bd9d0 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -339,7 +339,7 @@ validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args)
dprintk("%s enter. slotid %d seqid %d\n",
__func__, args->csa_slotid, args->csa_sequenceid);

- if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS)
+ if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS - 1)
return htonl(NFS4ERR_BADSLOT);

slot = nfs4_lookup_slot_locked(tbl, args->csa_slotid);
--
1.7.6.4



2011-11-04 14:40:40

by Anna Schumaker

[permalink] [raw]
Subject: Re: [PATCH (resend) Version 2 3/3] NFSv4.1: fix backchennel bug

"backchennel" in the subject should be "backchannel"

- Bryan

On 10/18/2011 02:39 AM, [email protected] wrote:
> From: Andy Adamson <[email protected]>
>
> Slotid's start from 0 which means we check against
> NFS41_BC_MAX_CALLBACKS - 1.
>
> Signed-off-by: Andy Adamson <[email protected]>
> ---
> fs/nfs/callback_proc.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
> index 98ff5fc..12bd9d0 100644
> --- a/fs/nfs/callback_proc.c
> +++ b/fs/nfs/callback_proc.c
> @@ -339,7 +339,7 @@ validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args)
> dprintk("%s enter. slotid %d seqid %d\n",
> __func__, args->csa_slotid, args->csa_sequenceid);
>
> - if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS)
> + if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS - 1)
> return htonl(NFS4ERR_BADSLOT);
>
> slot = nfs4_lookup_slot_locked(tbl, args->csa_slotid);


2011-11-04 14:31:33

by Myklebust, Trond

[permalink] [raw]
Subject: RE: [PATCH (resend) Version 2 3/3] NFSv4.1: fix backchennel bug

> -----Original Message-----
> From: Adamson, Andy
> Sent: Tuesday, October 18, 2011 2:40 AM
> To: Myklebust, Trond
> Cc: [email protected]; Adamson, Andy
> Subject: [PATCH (resend) Version 2 3/3] NFSv4.1: fix backchennel bug
>
> From: Andy Adamson <[email protected]>
>
> Slotid's start from 0 which means we check against
> NFS41_BC_MAX_CALLBACKS - 1.
>
> Signed-off-by: Andy Adamson <[email protected]>
> ---
> fs/nfs/callback_proc.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index
> 98ff5fc..12bd9d0 100644
> --- a/fs/nfs/callback_proc.c
> +++ b/fs/nfs/callback_proc.c
> @@ -339,7 +339,7 @@ validate_seqid(struct nfs4_slot_table *tbl, struct
> cb_sequenceargs * args)
> dprintk("%s enter. slotid %d seqid %d\n",
> __func__, args->csa_slotid, args->csa_sequenceid);
>
> - if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS)
> + if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS - 1)
> return htonl(NFS4ERR_BADSLOT);

Why not just replace '>' with '>='?

Cheers
Trond

2011-11-04 14:34:42

by Myklebust, Trond

[permalink] [raw]
Subject: RE: [PATCH (resend) Version 2 3/3] NFSv4.1: fix backchennel bug

> -----Original Message-----
> From: Myklebust, Trond
> Sent: Friday, November 04, 2011 10:32 AM
> To: Adamson, Andy
> Cc: [email protected]
> Subject: RE: [PATCH (resend) Version 2 3/3] NFSv4.1: fix backchennel
bug
>
> > -----Original Message-----
> > From: Adamson, Andy
> > Sent: Tuesday, October 18, 2011 2:40 AM
> > To: Myklebust, Trond
> > Cc: [email protected]; Adamson, Andy
> > Subject: [PATCH (resend) Version 2 3/3] NFSv4.1: fix backchennel bug
> >
> > From: Andy Adamson <[email protected]>
> >
> > Slotid's start from 0 which means we check against
> > NFS41_BC_MAX_CALLBACKS - 1.
> >
> > Signed-off-by: Andy Adamson <[email protected]>
> > ---
> > fs/nfs/callback_proc.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index
> > 98ff5fc..12bd9d0 100644
> > --- a/fs/nfs/callback_proc.c
> > +++ b/fs/nfs/callback_proc.c
> > @@ -339,7 +339,7 @@ validate_seqid(struct nfs4_slot_table *tbl,
struct
> > cb_sequenceargs * args)
> > dprintk("%s enter. slotid %d seqid %d\n",
> > __func__, args->csa_slotid, args->csa_sequenceid);
> >
> > - if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS)
> > + if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS - 1)
> > return htonl(NFS4ERR_BADSLOT);
>
> Why not just replace '>' with '>='?

BTW: Shouldn't this patch be 1/3 and be Cc: [email protected]? It
looks as if it ought to be backported to the stable kernels...

2011-11-04 14:43:29

by Jim Rees

[permalink] [raw]
Subject: Re: [PATCH (resend) Version 2 3/3] NFSv4.1: fix backchennel bug

You misspelled "backchannel" in the description. Also could be a bit more
descriptive:

NFSv4.1: fix backchannel slotid off-by-one bug