linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd41: Fix a crash when a callback is retried
@ 2010-06-28 17:33 Boaz Harrosh
  2010-06-28 17:38 ` Boaz Harrosh
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Boaz Harrosh @ 2010-06-28 17:33 UTC (permalink / raw)
  To: J. Bruce Fields, Benny Halevy, Labiaga, Ricardo, NFS list


If a callback is retried at nfsd4_cb_recall_done() do to
some error. The returned rpc reply would then crash here:

 @@ -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]

This is because the nfsd4_cb_done_sequence() has NULLed out
the task->tk_msg.rpc_resp pointer.

This problem was introduced by a 4.1 protocol addition patch:
	[0421b5c5] nfsd41: Backchannel: Implement cb_recall over NFSv4.1

Which was overlooking the possibility of an RPC callback retries.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfsd/nfs4callback.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index f3b5015..dace7e2 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -869,9 +869,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;
 	}
 }
 
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-08-23 22:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-28 17:33 [PATCH] nfsd41: Fix a crash when a callback is retried Boaz Harrosh
2010-06-28 17:38 ` Boaz Harrosh
2010-06-28 18:50 ` Benny Halevy
2010-06-29  7:43   ` Boaz Harrosh
2010-06-29 11:33 ` [PATCH version2] " Boaz Harrosh
2010-07-01 18:28   ` Benny Halevy
2010-07-20 14:37   ` Boaz Harrosh
2010-07-21 23:28     ` J. Bruce Fields
2010-08-05 14:22   ` J. Bruce Fields
2010-08-23 10:10     ` Boaz Harrosh
2010-08-23 22:32       ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).