From: dai.ngo@oracle.com
To: Chuck Lever III <chuck.lever@oracle.com>, Neil Brown <neilb@suse.de>
Cc: Jeff Layton <jlayton@kernel.org>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
Olga Kornievskaia <kolga@netapp.com>, Tom Talpey <tom@talpey.com>
Subject: Re: [PATCH 6/6] nfsd: allow delegation state ids to be revoked and then freed
Date: Wed, 1 Nov 2023 10:41:03 -0700 [thread overview]
Message-ID: <c08c56d0-cc5b-49c0-815c-da49e04ba22a@oracle.com> (raw)
In-Reply-To: <E4C94AEE-6CBA-44C4-AA45-C56E8458286E@oracle.com>
On 11/1/23 8:41 AM, Chuck Lever III wrote:
>
>> On Nov 1, 2023, at 12:43 AM, NeilBrown <neilb@suse.de> wrote:
>>
>> On Wed, 01 Nov 2023, Chuck Lever III wrote:
>>>> On Oct 31, 2023, at 8:01 PM, NeilBrown <neilb@suse.de> wrote:
>>>>
>>>> On Wed, 01 Nov 2023, Chuck Lever III wrote:
>>>>> Howdy Neil-
>>>>>
>>>>>> On Oct 31, 2023, at 5:57 PM, NeilBrown <neilb@suse.de> wrote:
>>>>>>
>>>>>> Revoking state through 'unlock_filesystem' now revokes any delegation
>>>>>> states found. When the stateids are then freed by the client, the
>>>>>> revoked stateids will be cleaned up correctly.
>>>>> Here's my derpy question of the day.
>>>>>
>>>>> "When the stateids are then freed by the client" seems to be
>>>>> a repeating trope, and it concerns me a bit (probably because
>>>>> I haven't yet learned how this mechanism /currently/ works)...
>>>>>
>>>>> In the case when the client has actually vanished (eg, was
>>>>> destroyed by an orchestrator), it's not going to be around
>>>>> to actively free revoked state. Doesn't that situation result
>>>>> in pinned state on the server? I would expect that's a primary
>>>>> use case for "unlock_filesystem."
>>>> If a client is de-orchestrated then it will stop renewing its lease, and
>>>> regular cleanup of expired state will kick in after one lease period.
>>> Thanks for educating me.
>>>
>>> Such state actually stays around for much longer now as
>>> expired but renewable state. Does unlock_filesystem need
>>> to purge courtesy state too, to make the target filesystem
>>> unexportable and unmountable?
>> I don't think there is any special case there that we need to deal with.
>> I haven't explored in detail but I think "courtesy" state is managed at
>> the client level. Some clients still have valid leases, others are
>> being maintained only as a courtesy. At the individual state level
>> there is no difference. The "unlock_filesystem" code examines all
>> states for all client and selects those for the target filesystem and
>> revokes those.
> Dai can correct me if I've misremembered, but NFSD's courteous
> server does not currently implement partial loss of state. If
> any of a client's state is lost while it is disconnected, the
> server discards its entire lease.
>
> Thus if an admin unlocks a filesystem that a disconnected client
> has some open files on, that client's entire lease should be
> purged.
Ben is correct, courtesy state is managed at the client level. The
server does not deal with individual state of the courtesy client.
The courtesy clients and their states are allowed to be around until
the memory shrinker kicks in and the worker starts reaping clients in
NFSD4_COURTESY state.
-Dai
>
>
>>>> So for NFSv4 we don't need to worry about disappearing clients.
>>>> For NFSv3 (or more specifically for NLM) we did and locks could hang
>>>> around indefinitely if the client died.
>>>> For that reason we have /proc/fs/nfsd/unlock_ip which discards all NFSv3
>>>> lock state for a given client. Extending that to NFSv4 is not needed
>>>> because of leases, and not meaningful because of trunking - a client
>>>> might have several IP's.
>>>>
>>>> unlock_filesystem is for when the client is still active and we want to
>>>> let it (them) continue accessing some filesystems, but not all.
>>>>
>>>> NeilBrown
>>>>
>>>>
>>>>> Maybe I've misunderstood something fundamental.
>>>>>
>>>>>
>>>>> --
>>>>> Chuck Lever
>>>
>>> --
>>> Chuck Lever
>
> --
> Chuck Lever
>
>
next prev parent reply other threads:[~2023-11-01 17:41 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 0:57 [PATCH 0/6 v2] support admin-revocation of v4 state NeilBrown
2023-11-01 0:57 ` [PATCH 1/6] nfsd: prepare for supporting admin-revocation of state NeilBrown
2023-11-01 2:14 ` Chuck Lever III
2023-11-01 2:49 ` NeilBrown
2023-11-02 10:46 ` Jeff Layton
2023-11-02 20:03 ` NeilBrown
2023-11-02 20:24 ` Jeff Layton
2023-11-02 20:29 ` Chuck Lever III
2023-11-03 1:08 ` NeilBrown
2023-11-03 14:34 ` Chuck Lever
2023-11-03 17:25 ` Jeff Layton
2023-11-02 11:25 ` Jeff Layton
2023-11-01 0:57 ` [PATCH 2/6] nfsd: allow admin-revoked state to appear in /proc/fs/nfsd/clients/*/states NeilBrown
2023-11-01 0:57 ` [PATCH 3/6] nfsd: allow admin-revoked NFSv4.0 state to be freed NeilBrown
2023-11-01 0:57 ` [PATCH 4/6] nfsd: allow lock state ids to be revoked and then freed NeilBrown
2023-11-01 0:57 ` [PATCH 5/6] nfsd: allow open " NeilBrown
2023-11-01 0:57 ` [PATCH 6/6] nfsd: allow delegation " NeilBrown
2023-11-01 2:10 ` Chuck Lever III
2023-11-01 3:01 ` NeilBrown
2023-11-01 5:41 ` Chuck Lever III
2023-11-01 7:43 ` NeilBrown
2023-11-01 15:41 ` Chuck Lever III
2023-11-01 17:41 ` dai.ngo [this message]
2023-11-02 11:29 ` [PATCH 0/6 v2] support admin-revocation of v4 state Jeff Layton
-- strict thread matches above, loose matches on Subject: below --
2023-10-27 1:45 [PATCH 0/6] " NeilBrown
2023-10-27 1:45 ` [PATCH 6/6] nfsd: allow delegation state ids to be revoked and then freed NeilBrown
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=c08c56d0-cc5b-49c0-815c-da49e04ba22a@oracle.com \
--to=dai.ngo@oracle.com \
--cc=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=kolga@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=tom@talpey.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