Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: NeilBrown <neilb@suse.de>
Cc: Jeff Layton <jlayton@kernel.org>,
	linux-nfs@vger.kernel.org, Olga Kornievskaia <kolga@netapp.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Subject: Re: [PATCH 6/9] nfsd: allow admin-revoked NFSv4.0 state to be freed.
Date: Sun, 19 Nov 2023 18:44:31 -0500	[thread overview]
Message-ID: <ZVqd3wt18EXETm+i@tissot.1015granger.net> (raw)
In-Reply-To: <170043402394.19300.7144468429486716541@noble.neil.brown.name>

On Mon, Nov 20, 2023 at 09:47:03AM +1100, NeilBrown wrote:
> On Sat, 18 Nov 2023, Chuck Lever wrote:
> > On Fri, Nov 17, 2023 at 01:18:52PM +1100, NeilBrown wrote:
> > > For NFSv4.1 and later the client easily discovers if there is any
> > > admin-revoked state and will then find and explicitly free it.
> > > 
> > > For NFSv4.0 there is no such mechanism.  The client can only find that
> > > state is admin-revoked if it tries to use that state, and there is no
> > > way for it to explicitly free the state.  So the server must hold on to
> > > the stateid (at least) for an indefinite amount of time.  A
> > > RELEASE_LOCKOWNER request might justify forgetting some of these
> > > stateids, as would the whole clients lease lapsing, but these are not
> > > reliable.
> > > 
> > > This patch takes two approaches.
> > > 
> > > Whenever a client uses an revoked stateid, that stateid is then
> > > discarded and will not be recognised again.  This might confuse a client
> > > which expect to get NFS4ERR_ADMIN_REVOKED consistently once it get it at
> > > all, but should mostly work.  Hopefully one error will lead to other
> > > resources being closed (e.g.  process exits), which will result in more
> > > stateid being freed when a CLOSE attempt gets NFS4ERR_ADMIN_REVOKED.
> > > 
> > > Also, any admin-revoked stateids that have been that way for more than
> > > one lease time are periodically revoke.
> > > 
> > > No actual freeing of state happens in this patch.  That will come in
> > > future patches which handle the different sorts of revoked state.
> > > 
> > > Signed-off-by: NeilBrown <neilb@suse.de>
> > > ---
> > >  fs/nfsd/netns.h     |  4 ++
> > >  fs/nfsd/nfs4state.c | 97 ++++++++++++++++++++++++++++++++++++++++++++-
> > >  2 files changed, 100 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
> > > index ec49b200b797..02f8fa095b0f 100644
> > > --- a/fs/nfsd/netns.h
> > > +++ b/fs/nfsd/netns.h
> > > @@ -197,6 +197,10 @@ struct nfsd_net {
> > >  	atomic_t		nfsd_courtesy_clients;
> > >  	struct shrinker		nfsd_client_shrinker;
> > >  	struct work_struct	nfsd_shrinker_work;
> > > +
> > > +	/* last time an admin-revoke happened for NFSv4.0 */
> > > +	time64_t		nfs40_last_revoke;
> > > +
> > >  };
> > 
> > This hunk doesn't apply to nfsd-next due to v6.7-rc changes to NFSD
> > to implement a dynamic shrinker. So I stopped my review here for
> > now.
> 
> I didn't a rebase onto nfsd-next and there were no conflicts!
> 
> I guess the change from
>   	struct work_struct	nfsd_shrinker_work;
> to
>   	struct work_struct	*nfsd_shrinker_work;
> 
> was technically a conflict but I'm surprised your tool complained..

That was the change I noticed when it failed to apply. "stg import"
is pretty picky, unfortunately...


-- 
Chuck Lever

  reply	other threads:[~2023-11-19 23:44 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  2:18 [PATCH 0/9 v3] support admin-revocation of v4 state NeilBrown
2023-11-17  2:18 ` [PATCH 1/9] nfsd: hold ->cl_lock for hash_delegation_locked() NeilBrown
2023-11-17 10:59   ` Jeff Layton
2023-11-19 21:37     ` NeilBrown
2023-11-19 23:38       ` Chuck Lever
2023-11-19 23:41         ` NeilBrown
2023-11-17 15:04   ` Chuck Lever
2023-11-19 22:07     ` NeilBrown
2023-11-17  2:18 ` [PATCH 2/9] nfsd: avoid race after unhash_delegation_locked() NeilBrown
2023-11-17 11:41   ` Jeff Layton
2023-11-17 19:43     ` Chuck Lever
2023-11-19 22:23       ` NeilBrown
2023-11-19 23:41         ` Chuck Lever
2023-11-17  2:18 ` [PATCH 3/9] nfsd: split sc_status out of sc_type NeilBrown
2023-11-17 19:52   ` Chuck Lever
2023-11-19 22:35     ` NeilBrown
2023-11-17  2:18 ` [PATCH 4/9] nfsd: prepare for supporting admin-revocation of state NeilBrown
2023-11-17  2:18 ` [PATCH 5/9] nfsd: allow admin-revoked state to appear in /proc/fs/nfsd/clients/*/states NeilBrown
2023-11-17 11:27   ` Jeff Layton
2023-11-19 22:36     ` NeilBrown
2023-11-17  2:18 ` [PATCH 6/9] nfsd: allow admin-revoked NFSv4.0 state to be freed NeilBrown
2023-11-17 11:34   ` Jeff Layton
2023-11-19 22:40     ` NeilBrown
2023-11-17 19:58   ` Chuck Lever
2023-11-19 22:47     ` NeilBrown
2023-11-19 23:44       ` Chuck Lever [this message]
2023-11-17  2:18 ` [PATCH 7/9] nfsd: allow lock state ids to be revoked and then freed NeilBrown
2023-11-17  2:18 ` [PATCH 8/9] nfsd: allow open " NeilBrown
2023-11-17  2:18 ` [PATCH 9/9] nfsd: allow delegation " NeilBrown
2023-11-17 12:25 ` [PATCH 0/9 v3] support admin-revocation of v4 state Jeff Layton
2023-11-19 23:21   ` 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=ZVqd3wt18EXETm+i@tissot.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=Dai.Ngo@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