Skip to contentSkip to conversation

SQUASHME: Support for cb_layout returning NFS4ERR_DELAY

PATCH In review Boaz Harrosh 2 participants 5 messages Jun 17, 2010 – Jul 1, 2010

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

PATCH 1/1 SQUASHME: Support for cb_layout returning NFS4ERR_DELAY

On a recall, a client may return NFS4ERR_DELAY to indicate that it is busy with the layout and wants to be poled.

TODO: If the client is stuck he would probably be cleaned
at expire client. But it is possible that the client is active/renewing but would not acknowledge the recall. We should take a time stamp on first recall and expire the client if a lease time has passed.

---
 fs/nfsd/nfs4callback.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
fs/nfsd/nfs4callback.c +6 -0
index e1faad4..8374ebd 100644
@@ -1044,6 +1044,12 @@ static void nfsd4_cb_layout_done(struct rpc_task *task, void *calldata)
 		 */
 		expire_client_lock(clp);
 		break;
+	case -NFS4ERR_DELAY:
+		/* Pole the client until it's done with the layout */
+		rpc_delay(task, HZ/100); /* 10 mili-seconds */
+		task->tk_status = 0;
+		rpc_restart_call(task);
+		break;
 	case -NFS4ERR_NOMATCHING_LAYOUT:
 		nomatching_layout(clr);
 	}
Signature · 1 line
1.7.0.1
#1 lore raw

Merged at pnfs-all-2.6.35-rc3-2010-06-17-1

Thanks!

Benny

Quoted 32 lines · Boaz Harrosh

On a recall, a client may return NFS4ERR_DELAY to indicate that it is busy with the layout and wants to be poled.

TODO: If the client is stuck he would probably be cleaned
at expire client. But it is possible that the client is active/renewing but would not acknowledge the recall. We should take a time stamp on first recall and expire the client if a lease time has passed.

---
 fs/nfsd/nfs4callback.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
fs/nfsd/nfs4callback.c +6 -0
index e1faad4..8374ebd 100644
@@ -1044,6 +1044,12 @@ static void nfsd4_cb_layout_done(struct rpc_task *task, void *calldata)
 		 */
 		expire_client_lock(clp);
 		break;
+	case -NFS4ERR_DELAY:
+		/* Pole the client until it's done with the layout */
+		rpc_delay(task, HZ/100); /* 10 mili-seconds */
+		task->tk_status = 0;
+		rpc_restart_call(task);
+		break;
 	case -NFS4ERR_NOMATCHING_LAYOUT:
 		nomatching_layout(clr);
 	}
#2 lore raw
In reply to Boaz Harrosh
Quoted 11 lines · Boaz Harrosh

On a recall, a client may return NFS4ERR_DELAY to indicate that it is busy with the layout and wants to be poled.

TODO: If the client is stuck he would probably be cleaned
at expire client. But it is possible that the client is active/renewing but would not acknowledge the recall. We should take a time stamp on first recall and expire the client if a lease time has passed.

So I was still crashing on callbacks all during bakethon even with this patch and Benny's fixes. (See below)

Quoted 9 lines
---
 fs/nfsd/nfs4callback.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
fs/nfsd/nfs4callback.c +0 -0
index e1faad4..8374ebd 100644

fs/nfsd/nfs4callback.c static void nfsd4_cb_layout_done(struct rpc_task *task, void *calldata) · line 1051

Quoted 8 lines
fs/nfsd/nfs4callback.c +5 -0
@@ -1044,6 +1044,12 @@ static void nfsd4_cb_layout_done(struct rpc_task *task, void *calldata)
 		 */
 		expire_client_lock(clp);
 		break;
+	case -NFS4ERR_DELAY:
+		/* Pole the client until it's done with the layout */
+		rpc_delay(task, HZ/100); /* 10 mili-seconds */
+		task->tk_status = 0;
+		rpc_restart_call(task);

When using rpc_restart_call here I get an hard crash at:

fs/nfsd/nfs4callback.c +1 -0
index f3b5015..7529f9a 100644
@@ -514,6 +514,7 @@ decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_cb_sequence *res,
 	u32 dummy;
 	__be32 *p;
 
+	BUG_ON(!res);
 	if (res->cbs_minorversion == 0)
 		return 0;
 

[BUG_ON added for demonstration]

The below code would fix it. (Obviously)

fs/nfsd/nfs4callback.c +0 -3
index f3b5015..7529f9a 100644
@@ -869,9 +870,6 @@ static void nfsd4_cb_done_sequence(struct rpc_task *task,
 		rpc_wake_up_next(&clp->cl_cb_waitq);
 		dprintk("%s: freed slot, new seqid=%d\n", __func__,
 			clp->cl_cb_seq_nr);
-
-		/* We're done looking into the sequence information */
-		task->tk_msg.rpc_resp = NULL;
 	}
 }
 

This is because when the second rpc, that was retried above in nfsd4_cb_layout_done() has a NULL ->rpc_resp. (Which is the struct nfsd4_cb_sequence *res parameter to decode_cb_sequence on reply from server).

Now this above nfsd4_cb_layout_done() is new pNFS code, but the same problem (crash) should apply when a retry is attempted in nfsd4_cb_recall_done(). So this hunk should go into current tree. (and stable)

The code was introduced by this patch:
0421b5c55acd0e88920cb9a5bcea6ed738186853
From: Ricardo Labiaga <[email protected]>
Subject: [PATCH] nfsd41: Backchannel: Implement cb_recall over NFSv4.1

I guess it was never tested with error on callback and retry attempt. Ricardo what was the original intention of the line above (plus the comment)

[I'll send an official patch to Bruce as well]

Thanks
Boaz

Quoted 4 lines
fs/nfsd/nfs4callback.c +1 -0
+		break;
 	case -NFS4ERR_NOMATCHING_LAYOUT:
 		nomatching_layout(clr);
 	}
#3 lore raw

PATCH 1/1 SQUASHME: into [SQUASHME: pnfsd: Support for cb_layout returning NFS4ERR_DELAY]

This is the correct code.

---
 fs/nfsd/nfs4callback.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4callback.c +1 -1
index 3bbeae8..60c719c 100644
@@ -1046,7 +1046,7 @@ static void nfsd4_cb_layout_done(struct rpc_task *task, void *calldata)
 		/* Pole the client until it's done with the layout */
 		rpc_delay(task, HZ/100); /* 10 mili-seconds */
 		task->tk_status = 0;
-		rpc_restart_call(task);
+		rpc_restart_call_prepare(task);
 		break;
 	case -NFS4ERR_NOMATCHING_LAYOUT:
 		task->tk_status = 0;
Signature · 1 line
1.6.6.1
#4 lore raw

Re: [PATCH] SQUASHME: into [SQUASHME: pnfsd: Support for cb_layout returning NFS4ERR_DELAY]

Quoted 4 lines · Boaz Harrosh

This is the correct code.

Merged at pnfs-all-2.6.35-rc3-2010-07-01

Thanks!

Benny

Quoted 17 lines
---
 fs/nfsd/nfs4callback.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4callback.c +1 -1
index 3bbeae8..60c719c 100644
@@ -1046,7 +1046,7 @@ static void nfsd4_cb_layout_done(struct rpc_task *task, void *calldata)
 		/* Pole the client until it's done with the layout */
 		rpc_delay(task, HZ/100); /* 10 mili-seconds */
 		task->tk_status = 0;
-		rpc_restart_call(task);
+		rpc_restart_call_prepare(task);
 		break;
 	case -NFS4ERR_NOMATCHING_LAYOUT:
 		task->tk_status = 0;