All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fred Isaman <iisaman@netapp.com>
To: linux-nfs@vger.kernel.org
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: [PATCH 07/15] pnfs: layoutget rpc code cleanup
Date: Thu, 23 Dec 2010 12:29:49 -0500	[thread overview]
Message-ID: <1293125397-30088-8-git-send-email-iisaman@netapp.com> (raw)
In-Reply-To: <1293125397-30088-1-git-send-email-iisaman@netapp.com>

No functional changes, just some code minor code rearrangement and
comments.

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

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f475516..1609a07 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5297,10 +5297,14 @@ static void
 nfs4_layoutget_prepare(struct rpc_task *task, void *calldata)
 {
 	struct nfs4_layoutget *lgp = calldata;
-	struct inode *ino = lgp->args.inode;
-	struct nfs_server *server = NFS_SERVER(ino);
+	struct nfs_server *server = NFS_SERVER(lgp->args.inode);
 
 	dprintk("--> %s\n", __func__);
+	/* Note the is a race here, where a CB_LAYOUTRECALL can come in
+	 * right now covering the LAYOUTGET we are about to send.
+	 * However, that is not so catastrophic, and there seems
+	 * to be no way to prevent it completely.
+	 */
 	if (nfs4_setup_sequence(server, &lgp->args.seq_args,
 				&lgp->res.seq_res, 0, task))
 		return;
@@ -5383,13 +5387,10 @@ int nfs4_proc_layoutget(struct nfs4_layoutget *lgp)
 	if (IS_ERR(task))
 		return PTR_ERR(task);
 	status = nfs4_wait_for_completion_rpc_task(task);
-	if (status != 0)
-		goto out;
-	status = task->tk_status;
-	if (status != 0)
-		goto out;
-	status = pnfs_layout_process(lgp);
-out:
+	if (status == 0)
+		status = task->tk_status;
+	if (status == 0)
+		status = pnfs_layout_process(lgp);
 	rpc_put_task(task);
 	dprintk("<-- %s status=%d\n", __func__, status);
 	return status;
-- 
1.7.2.1


  parent reply	other threads:[~2010-12-23 17:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-23 17:29 [PATCH 00/15] pnfs wave 2 submission, try 4 Fred Isaman
2010-12-23 17:29 ` [PATCH 01/15] pnfs: fix incorrect comment in destroy_lseg Fred Isaman
2010-12-23 17:29 ` [PATCH 02/15] pnfs: remove unnecessary field lgp->status Fred Isaman
2010-12-23 17:29 ` [PATCH 03/15] pnfs: add prefix to struct pnfs_layout_segment fields Fred Isaman
2010-12-23 17:29 ` [PATCH 04/15] pnfs: add prefix to struct pnfs_layout_hdr fields Fred Isaman
2010-12-23 17:29 ` [PATCH 05/15] pnfs: change layout state seqlock to a spinlock Fred Isaman
2010-12-23 17:29 ` [PATCH 06/15] pnfs: change how lsegs are removed from layout list Fred Isaman
2010-12-23 17:29 ` Fred Isaman [this message]
2010-12-23 17:29 ` [PATCH 08/15] pnfs: serialize LAYOUTGET(openstateid) Fred Isaman
2010-12-23 17:29 ` [PATCH 09/15] pnfs: add layout to client list before sending rpc Fred Isaman
2010-12-23 17:29 ` [PATCH 10/15] pnfs: check that partial LAYOUTGET return is ignored Fred Isaman
2010-12-23 17:29 ` [PATCH 11/15] pnfs: change lo refcounting to atomic_t Fred Isaman
2010-12-23 17:29 ` [PATCH 12/15] pnfs: CB_LAYOUTRECALL xdr code Fred Isaman
2010-12-23 17:29 ` [PATCH 13/15] pnfs: add CB_LAYOUTRECALL handling Fred Isaman
2010-12-23 19:25   ` Trond Myklebust
2010-12-23 20:08     ` Fred Isaman
2010-12-23 21:05       ` Trond Myklebust
2010-12-23 21:09         ` Fred Isaman
2010-12-23 17:29 ` [PATCH 14/15] pnfs: update nfs4_callback_recallany to handle layouts Fred Isaman
2010-12-23 17:29 ` [PATCH 15/15] pnfs: layout roc code Fred Isaman
  -- strict thread matches above, loose matches on Subject: below --
2011-01-06 11:36 [PATCH 00/15] pnfs wave 2 submission Fred Isaman
2011-01-06 11:36 ` [PATCH 07/15] pnfs: layoutget rpc code cleanup Fred Isaman
2010-12-23 23:54 [PATCH 00/15] pnfs wave 2 submission, try 5 Fred Isaman
2010-12-23 23:54 ` [PATCH 07/15] pnfs: layoutget rpc code cleanup Fred Isaman
2010-12-23 12:47 [PATCH 00/15] pnfs wave 2 submission, try 3 Fred Isaman
2010-12-23 12:47 ` [PATCH 07/15] pnfs: layoutget rpc code cleanup Fred Isaman
2010-12-22  4:00 [PATCH 00/15] pnfs wave 2 submission, try 2 Fred Isaman
2010-12-22  4:00 ` [PATCH 07/15] pnfs: layoutget rpc code cleanup Fred Isaman

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=1293125397-30088-8-git-send-email-iisaman@netapp.com \
    --to=iisaman@netapp.com \
    --cc=Trond.Myklebust@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.