Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 0/6 v2] support admin-revocation of v4 state
@ 2023-11-01  0:57 NeilBrown
  2023-11-01  0:57 ` [PATCH 1/6] nfsd: prepare for supporting admin-revocation of state NeilBrown
                   ` (6 more replies)
  0 siblings, 7 replies; 27+ messages in thread
From: NeilBrown @ 2023-11-01  0:57 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton
  Cc: linux-nfs, Olga Kornievskaia, Dai Ngo, Tom Talpey

This set fixes two issues found by kernel test robot
1/ nfsd4_revoke_states() needs to be defined when not CONFIG_NFSD_V4
2/ nfs40_last_revoke is larger than a mechine word in 32 bit configs,
   so needs protection - use nn->client_lock which is already taken when
   nfs40_last_revoke is accessed.

NeilBrown




^ permalink raw reply	[flat|nested] 27+ messages in thread
* [PATCH 0/6] support admin-revocation of v4 state
@ 2023-10-27  1:45 NeilBrown
  2023-10-27  1:45 ` [PATCH 1/6] nfsd: prepare for supporting admin-revocation of state NeilBrown
  0 siblings, 1 reply; 27+ messages in thread
From: NeilBrown @ 2023-10-27  1:45 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton
  Cc: linux-nfs, Olga Kornievskaia, Dai Ngo, Tom Talpey

This is a revised version of a patch set I sent over a year ago.
It now supports v4.0 and has had more testing.

There are cirsumstances where an admin might need to unmount a
filesystem that is NFS-exported and in active use, but does not want to
stop the NFS server completely.  These are certainly unusual
circumstance and doing this might negatively impact any clients acting
on the filesystem, but the admin should be able to do this.

Currently this is quite possible for for NFSv3.  Unexporting the
filesystem will ensure no new opens happen, and writing the path name to
/proc/fs/nfsd/unlock_filesystem will ensure anly NLM locks held in the
filesystem are released so that NFSD no longer prevents the filesystem
from being unlocked.

It is not currently possible for NFSv4.  Writing to unlock_filesystem
does not affect NFSv4, which is arguably a bug.  This series fixes the bug.

For NFSv4.1 and later code is straight forward.  We add new state types
for admin-revoked state (open, lock, deleg) and change the type of any
state on a filesystem - inavlidating any access and closing files as we
go.  While there are any revoked states we report this to the client in
the response to SEQUENCE requests, and it will check and free any states
that need to be freed.

For NFSv4.0 it isn't quite so easy as there is no mechanism for the
client to explicitly acknowledged admin-revoked states.  The approach
this patchset takes is to discard NFSv4.0 admin-revoked states one
lease-time after they were revoked, or immediately for a state that the
client tryies to use and gets an "ADMIN_REVOKED" error for.  If the
filestystem has been unmounted (as expected), the client will see STATE
errors before it has a chance to see ADMIN_REVOKED errors, so most often
the timeout will be how states are discarded.

NeilBrown

 [PATCH 1/6] nfsd: prepare for supporting admin-revocation of state
 [PATCH 2/6] nfsd: allow admin-revoked state to appear in
 [PATCH 3/6] nfsd: allow admin-revoked NFSv4.0 state to be freed.
 [PATCH 4/6] nfsd: allow lock state ids to be revoked and then freed
 [PATCH 5/6] nfsd: allow open state ids to be revoked and then freed
 [PATCH 6/6] nfsd: allow delegation state ids to be revoked and then


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2023-11-03 17:25 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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 1/6] nfsd: prepare for supporting admin-revocation of state NeilBrown
2023-10-31  2:45   ` kernel test robot
2023-10-31  3:17   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox