From: "J. Bruce Fields" <bfields@citi.umich.edu>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Benny Halevy <bhalevy@panasas.com>,
"Labiaga, Ricardo" <Ricardo.Labiaga@netapp.com>,
NFS list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH version2] nfsd41: Fix a crash when a callback is retried
Date: Thu, 5 Aug 2010 10:22:26 -0400 [thread overview]
Message-ID: <20100805142226.GA27141@fieldses.org> (raw)
In-Reply-To: <4C29DA23.90200@panasas.com>
On Tue, Jun 29, 2010 at 02:33:55PM +0300, Boaz Harrosh wrote:
>
> 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;
Thanks, applied. There may be a delay before it shows up in my
for-2.6.36 queue, while I sort out a few other bugs.
(We still have problems here: getting a new slot isn't always the
correct thing to do, depending on the error. But this seems an
improvement....).
--b.
>
> [BUG_ON added for demonstration]
>
> This is because the nfsd4_cb_done_sequence() has NULLed out
> the task->tk_msg.rpc_resp pointer.
>
> Also eventually the rpc would use the new slot without making
> sure it is free by calling nfsd41_cb_setup_sequence().
>
> 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.
> For not-4.1 case redoing the _prepare is harmless.
>
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
> fs/nfsd/nfs4callback.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index f3b5015..3bbeae8 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -913,7 +913,7 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata)
> if (dp->dl_retries--) {
> rpc_delay(task, 2*HZ);
> task->tk_status = 0;
> - rpc_restart_call(task);
> + rpc_restart_call_prepare(task);
> return;
> } else {
> atomic_set(&clp->cl_cb_set, 0);
> --
> 1.6.6.1
>
>
next prev parent reply other threads:[~2010-08-05 14:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2010-08-23 10:10 ` Boaz Harrosh
2010-08-23 22:32 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100805142226.GA27141@fieldses.org \
--to=bfields@citi.umich.edu \
--cc=Ricardo.Labiaga@netapp.com \
--cc=bhalevy@panasas.com \
--cc=bharrosh@panasas.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).