All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 2/6] NFSv4.1/pnfs: Fix serialisation of layout return and layoutget
Date: Tue,  4 Aug 2015 22:29:52 -0400	[thread overview]
Message-ID: <1438741796-22681-2-git-send-email-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <1438741796-22681-1-git-send-email-trond.myklebust@primarydata.com>

We should always test for outstanding layout returns, whether or not
pnfs_should_retry_layoutget() is true.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/pnfs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index aa95544123c5..5280def00bc4 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1436,6 +1436,8 @@ static int pnfs_layoutget_retry_bit_wait(struct wait_bit_key *key)
 
 static bool pnfs_prepare_to_retry_layoutget(struct pnfs_layout_hdr *lo)
 {
+	if (!pnfs_should_retry_layoutget(lo))
+		return false;
 	/*
 	 * send layoutcommit as it can hold up layoutreturn due to lseg
 	 * reference
@@ -1531,8 +1533,7 @@ lookup_again:
 	 * Because we free lsegs before sending LAYOUTRETURN, we need to wait
 	 * for LAYOUTRETURN even if first is true.
 	 */
-	if (!lseg && pnfs_should_retry_layoutget(lo) &&
-	    test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) {
+	if (test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) {
 		spin_unlock(&ino->i_lock);
 		dprintk("%s wait for layoutreturn\n", __func__);
 		if (pnfs_prepare_to_retry_layoutget(lo)) {
-- 
2.4.3


  reply	other threads:[~2015-08-05  2:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05  2:29 [PATCH 1/6] NFSv4.1/pnfs: Remove redundant checks in pnfs_layoutgets_blocked() Trond Myklebust
2015-08-05  2:29 ` Trond Myklebust [this message]
2015-08-05  2:29   ` [PATCH 3/6] NFSv4.1/pnfs: Don't prevent layoutgets when doing return-on-close Trond Myklebust
2015-08-05  2:29     ` [PATCH 4/6] NFSv4.1/pnfs: Remove redundant lo->plh_block_lgets in layoutreturn Trond Myklebust
2015-08-05  2:29       ` [PATCH 5/6] NFSv4.1/pnfs: Remove redundant check in pnfs_layoutgets_blocked() Trond Myklebust
2015-08-05  2:29         ` [PATCH 6/6] NFSv4.1/pnfs: Remove redundant wakeup in pnfs_send_layoutreturn() Trond Myklebust
2015-08-17 14:42     ` [PATCH 3/6] NFSv4.1/pnfs: Don't prevent layoutgets when doing return-on-close Christoph Hellwig
2015-08-18 11:33       ` Christoph Hellwig

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=1438741796-22681-2-git-send-email-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.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.