[pnfs] Resend: [PATCH] client callback xdr generic error handling

Benny Halevy bhalevy at panasas.com
Thu Jul 12 12:45:12 EDT 2007



-------- Original Message --------
Subject: [PATCH] client callback xdr generic error handling
Date: Mon,  9 Jul 2007 16:02:19 +0300
From: Benny Halevy <bhalevy at panasas.com>
To: pnfs at linux-pnfs.org
CC: Benny Halevy <bhalevy at panasas.com>

return NFS4ERR_OP_ILLEGAL rather than NFS4ERR_OP_NOT_IN_SESSION
when appropriate.

Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfs/callback_xdr.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index d046b87..36e1f02 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -542,6 +542,8 @@ static unsigned process_op(uint32_t minorversion, int nop,
 	if (unlikely(status))
 		goto out_illegal;
 
+	dprintk("%s: minorversion=%d nop=%d op_nr=%u\n",
+	        __FUNCTION__, minorversion, nop, op_nr);
 #if defined(CONFIG_NFS_V4_1)
 	if (minorversion == 1) {
 		if (op_nr == OP_CB_SEQUENCE) {
@@ -549,10 +551,9 @@ static unsigned process_op(uint32_t minorversion, int nop,
 				status = htonl(NFS4ERR_SEQUENCE_POS);
 				goto out;
 			}
-		} else if (nop == 1) {
+		} else if (nop == 1)
 			status = htonl(NFS4ERR_OP_NOT_IN_SESSION);
-			goto out;
-		}
+
 		switch (op_nr) {
 			case OP_CB_GETATTR:
 			case OP_CB_RECALL:
@@ -568,7 +569,8 @@ static unsigned process_op(uint32_t minorversion, int nop,
 			case OP_CB_WANTS_CANCELLED:
 			case OP_CB_NOTIFY_LOCK:
 				op = &callback_ops[0];
-				status = htonl(NFS4ERR_NOTSUPP);
+				if (status == 0)
+					status = htonl(NFS4ERR_NOTSUPP);
 				break;
 			default:
 				goto out_illegal;
-- 
1.5.2.86.g99b5


More information about the pNFS mailing list