NFSv4.1: fix backchennel bug
Subsystems (2)
PATCH 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.
--- fs/nfs/callback_proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/callback_proc.c +1 -1
@@ -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);
Signature · 1 line
1.7.6.4
Quoted 22 lines
-----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 bugFrom: 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(-)fs/nfs/callback_proc.c index renamed from fs/nfs/callback_proc.c +0
-098ff5fc..12bd9d0 100644
fs/nfs/callback_proc.c validate_seqid(struct nfs4_slot_table *tbl, struct · line 344
Quoted 7 lines
fs/nfs/callback_proc.c +1
-1@@ -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
Quoted 6 lines
-----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
Quoted 18 lines
Quoted 18 lines
-----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 bugFrom: 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(-)
Quoted 5 lines
fs/nfs/callback_proc.c validate_seqid(struct nfs4_slot_table *tbl,
Quoted 5 lines
fs/nfs/callback_proc.c index renamed from fs/nfs/callback_proc.c +0
-098ff5fc..12bd9d0 100644
fs/nfs/callback_proc.c +0
-0@@ -339,7 +339,7 @@ validate_seqid(struct nfs4_slot_table *tbl,
struct
Quoted 9 lines
fs/nfs/callback_proc.c validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args) · line 343
Quoted 7 lines
fs/nfs/callback_proc.c +1
-1cb_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...
"backchennel" in the subject should be "backchannel"
- Bryan
Quoted 23 lines · 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(-)fs/nfs/callback_proc.c +1
-1@@ -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);
You misspelled "backchannel" in the description. Also could be a bit more descriptive:
NFSv4.1: fix backchannel slotid off-by-one bug