Skip to contentSkip to conversation

NFSv4.1: fix backchennel bug

PATCH In review [email protected] 4 participants 5 messages Nov 4, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 98ff5fc..12bd9d0 100644
@@ -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
#1 lore raw
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 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 index renamed from fs/nfs/callback_proc.c +0 -0

98ff5fc..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

#2 lore raw
In reply to [email protected]
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 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(-)
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 -0

98ff5fc..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 -1
 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...

#3 lore raw
In reply to [email protected]

"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.

---
 fs/nfs/callback_proc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/callback_proc.c +1 -1
index 98ff5fc..12bd9d0 100644
@@ -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);