From: Chuck Lever <chuck.lever@oracle.com>
To: William Dauchy <wdauchy@gmail.com>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] NFS: Fix an LOCK/OPEN race when unlinking an open file
Date: Mon, 25 Apr 2016 10:45:51 -0400 [thread overview]
Message-ID: <513806FE-20EF-4285-ACF8-2C85AB72908F@oracle.com> (raw)
In-Reply-To: <CAJ75kXZaa66W74BgPHsJ7ND7-9EBzz____91h6Bx1qu=38OzAw@mail.gmail.com>
> On Apr 25, 2016, at 10:34 AM, William Dauchy <wdauchy@gmail.com> wrote:
>
> Hello,
>
> On Mon, Apr 11, 2016 at 10:20 PM, Chuck Lever <chuck.lever@oracle.com> wrote:
>> At Connectathon 2016, we found that recent upstream Linux clients
>> would occasionally send a LOCK operation with a zero stateid. This
>> appeared to happen in close proximity to another thread returning
>> a delegation before unlinking the same file while it remained open.
>>
>> Earlier, the client received a write delegation on this file and
>> returned the open stateid. Now, as it is getting ready to unlink the
>> file, it returns the write delegation. But there is still an open
>> file descriptor on that file, so the client must OPEN the file
>> again before it returns the delegation.
>>
>> Since commit 24311f884189 ('NFSv4: Recovery of recalled read
>> delegations is broken'), nfs_open_delegation_recall() clears the
>> NFS_DELEGATED_STATE flag _before_ it sends the OPEN. This allows a
>> racing LOCK on the same inode to be put on the wire before the OPEN
>> operation has returned a valid open stateid.
>>
>> To eliminate this race, serialize delegation return with the
>> acquisition of a file lock on the same file. Adopt the same approach
>> as is used in the unlock path.
>>
>> Fixes: 24311f884189 ('NFSv4: Recovery of recalled read ... ')
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>
>
> Is it something which is going to be merged in v4.7?
> It also might be a good candidate for stable?
William, only the NFS maintainers can answer these questions.
I really don't know.
--
Chuck Lever
next prev parent reply other threads:[~2016-04-25 14:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-11 20:20 [PATCH] NFS: Fix an LOCK/OPEN race when unlinking an open file Chuck Lever
2016-04-25 14:34 ` William Dauchy
2016-04-25 14:45 ` Chuck Lever [this message]
2016-04-26 14:24 ` Olga Kornievskaia
2016-04-28 12:43 ` William Dauchy
2016-04-28 13:13 ` Anna Schumaker
2016-04-28 14:06 ` Chuck Lever
2016-04-28 14:09 ` Anna Schumaker
2016-04-28 15:56 ` Olga Kornievskaia
2016-04-28 16:05 ` Chuck Lever
2016-04-28 17:22 ` Anna Schumaker
2016-04-28 17:40 ` Olga Kornievskaia
2016-04-28 21:11 ` Anna Schumaker
2016-04-29 13:48 ` Olga Kornievskaia
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=513806FE-20EF-4285-ACF8-2C85AB72908F@oracle.com \
--to=chuck.lever@oracle.com \
--cc=anna.schumaker@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
--cc=wdauchy@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox