All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: linux-nfs@vger.kernel.org
Cc: Benjamin Coddington <bcodding@redhat.com>,
	Jeff Layton <jlayton@redhat.com>
Subject: [PATCH 2/2] NFSv4: Don't call close if the open stateid has already been cleared
Date: Mon, 14 Nov 2016 11:19:56 -0500	[thread overview]
Message-ID: <1479140396-17779-3-git-send-email-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <1479140396-17779-2-git-send-email-trond.myklebust@primarydata.com>

Ensure we test to see if the open stateid is actually set, before we
send a CLOSE.

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

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b7b0080977c0..b801040c9585 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3129,7 +3129,8 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
 	} else if (is_rdwr)
 		calldata->arg.fmode |= FMODE_READ|FMODE_WRITE;
 
-	if (!nfs4_valid_open_stateid(state))
+	if (!nfs4_valid_open_stateid(state) ||
+	    test_bit(NFS_OPEN_STATE, &state->flags) == 0)
 		call_close = 0;
 	spin_unlock(&state->owner->so_lock);
 
-- 
2.7.4


  reply	other threads:[~2016-11-14 16:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 16:19 [PATCH 0/2] Fix CLOSE races Trond Myklebust
2016-11-14 16:19 ` [PATCH 1/2] NFSv4: Fix CLOSE races with OPEN Trond Myklebust
2016-11-14 16:19   ` Trond Myklebust [this message]
2016-11-14 16:40   ` Jeff Layton
2016-11-14 16:48     ` Trond Myklebust
2018-02-13 20:08   ` Olga Kornievskaia
2018-02-14 15:05     ` Benjamin Coddington
2018-02-14 15:21       ` Jeff Layton
2018-02-14 15:29         ` Trond Myklebust
2018-02-14 15:42           ` Benjamin Coddington
2018-02-14 16:06             ` Olga Kornievskaia
2018-02-14 16:59               ` Trond Myklebust
2018-02-14 22:17                 ` Olga Kornievskaia
2018-02-15 12:19     ` Mkrtchyan, Tigran
2018-02-15 12:23       ` Jeff Layton
2018-02-15 15:29         ` Bruce Fields
2018-02-15 15:37           ` 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=1479140396-17779-3-git-send-email-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=bcodding@redhat.com \
    --cc=jlayton@redhat.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.