linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fred Isaman <iisaman@netapp.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 5/6] pnfs-submit: nfs4_layoutreturn_release would crash on a bulk return
Date: Thu, 28 Oct 2010 15:10:00 -0400	[thread overview]
Message-ID: <1288293001-26289-5-git-send-email-iisaman@netapp.com> (raw)
In-Reply-To: <1288293001-26289-1-git-send-email-iisaman@netapp.com>

Only reference lo if in the FILE case.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/nfs4proc.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 4705ea6..96bd822 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5669,12 +5669,11 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
 static void nfs4_layoutreturn_release(void *calldata)
 {
 	struct nfs4_layoutreturn *lrp = calldata;
-	struct pnfs_layout_hdr *lo = NFS_I(lrp->args.inode)->layout;
 
-	dprintk("--> %s return_type %d lo %p\n", __func__,
-		lrp->args.return_type, lo);
+	dprintk("--> %s return_type %d\n", __func__, lrp->args.return_type);
 
 	if (lrp->args.return_type == RETURN_FILE) {
+		struct pnfs_layout_hdr *lo = NFS_I(lrp->args.inode)->layout;
 		spin_lock(&lo->inode->i_lock);
 		if (!lrp->res.lrs_present)
 			pnfs_invalidate_layout_stateid(lo);
-- 
1.7.2.1


  parent reply	other threads:[~2010-10-28 19:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-28 19:09 [PATCH 1/6] NFSv4.1: Callback share session between ops Fred Isaman
2010-10-28 19:09 ` [PATCH 2/6] pnfs-submit: change pnfs_layout_segment refcounting from kref to atomic_t Fred Isaman
2010-10-28 19:09 ` [PATCH 3/6] pnfs-submit: remove _pnfs_can_return_lseg call from pnfs_clear_lseg_list Fred Isaman
2010-10-28 19:09 ` [PATCH 4/6] pnfs-submit: change layout state seqlock to a spinlock Fred Isaman
2010-10-28 19:10 ` Fred Isaman [this message]
2010-10-28 19:10 ` [PATCH 6/6] pnfs_submit: fix layoutreturn layout stateid processing Fred Isaman
2010-10-28 19:35 ` [PATCH 1/6] NFSv4.1: Callback share session between ops Trond Myklebust
2010-10-28 20:18   ` Andy Adamson
2010-10-28 21:31     ` Trond Myklebust

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=1288293001-26289-5-git-send-email-iisaman@netapp.com \
    --to=iisaman@netapp.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).