All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benjamin Coddington" <bcodding@redhat.com>
To: "Trond Myklebust" <trondmy@primarydata.com>
Cc: "Linux List" <linux-nfs@vger.kernel.org>
Subject: Re: CLOSE/OPEN race
Date: Sat, 12 Nov 2016 13:46:59 -0500	[thread overview]
Message-ID: <F1C31BD6-78C8-4D7B-8C9C-42083CCC176A@redhat.com> (raw)
In-Reply-To: <C70DF662-8158-4842-9A52-5E1BE42C7FD5@primarydata.com>

On 12 Nov 2016, at 13:16, Trond Myklebust wrote:

>
>> On Nov 12, 2016, at 06:08, Benjamin Coddington <bcodding@redhat.com> 
>> wrote:
>>
>> I've been seeing the following on a modified version of generic/089
>> that gets the client stuck sending LOCK with NFS4ERR_OLD_STATEID.
>>
>> 1. Client has open stateid A, sends a CLOSE
>> 2. Client sends OPEN with same owner
>> 3. Client sends another OPEN with same owner
>> 4. Client gets a reply to OPEN in 3, stateid is B.2 (stateid B 
>> sequence 2)
>> 5. Client does LOCK,LOCKU,FREE_STATEID from B.2
>> 6. Client gets a reply to CLOSE in 1
>> 7. Client gets reply to OPEN in 2, stateid is B.1
>> 8. Client sends LOCK with B.1 - OLD_STATEID, now stuck in a loop
>>
>> The CLOSE response in 6 causes us to clear NFS_OPEN_STATE, so that 
>> the OPEN
>> response in 7 is able to update the open_stateid even though it has a 
>> lower
>> sequence number.
>
> Hmm… We probably should not do that if the stateid.other field of A 
> (i.e.
> the one supplied as the argument to CLOSE) does not match the
> stateid.other of B.  In fact, the reply in (4), where the stateid 
> changes
> to B, should be the thing that resets the OPEN state.

At 4, by reset the OPEN state, do you mean we should expect and wait for 
a
pending close to complete, or we should start over with a brand new 
state?
Maybe something else..

The reason the NFS_OPEN_STATE flag is cleared in 6 is that all the state
counts (n_rdwr, n_rdonly, n_wronly) are zero.   There could be a 
"pending
open" flag or counter that would help 6 not clear NFS_OPEN_STATE..

  reply	other threads:[~2016-11-12 18:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-12 11:08 CLOSE/OPEN race Benjamin Coddington
2016-11-12 12:54 ` Jeff Layton
2016-11-12 15:31   ` Benjamin Coddington
2016-11-12 16:52     ` Jeff Layton
2016-11-12 18:03       ` Benjamin Coddington
2016-11-12 21:16         ` Jeff Layton
2016-11-13  2:56           ` Jeff Layton
2016-11-13 13:34             ` Benjamin Coddington
2016-11-13 14:22               ` Benjamin Coddington
2016-11-13 14:33               ` Jeff Layton
2016-11-13 14:47             ` Trond Myklebust
2016-11-14 14:53               ` Benjamin Coddington
2016-11-14 16:29                 ` Trond Myklebust
2016-11-14 18:40                   ` Benjamin Coddington
2016-11-12 18:16 ` Trond Myklebust
2016-11-12 18:46   ` Benjamin Coddington [this message]
2016-11-13  3:09   ` Jeff Layton

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=F1C31BD6-78C8-4D7B-8C9C-42083CCC176A@redhat.com \
    --to=bcodding@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@primarydata.com \
    /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.