All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: NeilBrown <neilb@suse.de>
Cc: Chuck Lever <chuck.lever@oracle.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 00/14] SUNRPC: clean up server thread management.
Date: Mon, 22 Nov 2021 10:18:23 -0500	[thread overview]
Message-ID: <20211122151823.GA22802@fieldses.org> (raw)
In-Reply-To: <20211122033840.GD12035@fieldses.org>

On Sun, Nov 21, 2021 at 10:38:40PM -0500, J. Bruce Fields wrote:
> On Sun, Nov 21, 2021 at 09:37:53PM -0500, J. Bruce Fields wrote:
> > On Mon, Nov 22, 2021 at 12:13:08PM +1100, NeilBrown wrote:
> > > On Mon, 22 Nov 2021, J. Bruce Fields wrote:
> > > > On Sun, Nov 21, 2021 at 07:56:39PM -0500, J. Bruce Fields wrote:
> > > > > On Mon, Nov 22, 2021 at 10:50:34AM +1100, NeilBrown wrote:
> > > > > > On Thu, 18 Nov 2021, J. Bruce Fields wrote:
> > > > > > > On Wed, Nov 17, 2021 at 11:46:49AM +1100, NeilBrown wrote:
> > > > > > > > I have a dream of making nfsd threads start and stop dynamically.
> > > > > > > 
> > > > > > > It's a good dream!
> > > > > > > 
> > > > > > > I haven't had a chance to look at these at all yet, I just kicked off
> > > > > > > tests to run overnight, and woke up to the below.
> > > > > > > 
> > > > > > > This happened on the client, probably the first time it attempted to do
> > > > > > > an nfsv4 mount, so something went wrong with setup of the callback
> > > > > > > server.
> > > > > > 
> > > > > > I cannot reproduce this and cannot see any way it could possible happen.
> > > > > 
> > > > > Huh.  Well, it's possible I mixed up the results somehow.  I'll see if I
> > > > > can reproduce tonight or tomorrow.
> > > > > 
> > > > > > Could you please confirm the patches were applied on a vanilla 5.1.6-rc1
> > > > > > kernel, and that you don't have the "pool_mode" module parameter set.
> > > > > 
> > > > > /sys/module/sunrpc/parameters/pool_mode is "global", the default.
> > > > 
> > > > Oh, and yes, this is what I was testing, should just be 5.16-rc1 plus
> > > > your 14 patches:
> > > > 
> > > > 	http://git.linux-nfs.org/?p=bfields/linux-topics.git;a=shortlog;h=659e13af1f8702776704676937932f332265d85e
> > 
> > OK, tried again and it did indeed reproduce in the same spot.
> > 
> > > I did find a possible problem.  Very first patch.
> > > in fs/nfsd/nfsctl.c, in _write_ports_addfd()
> > >   if (!err && !nn->nfsd_serv->sv_nrthreads && !xchg(&nn->keep_active, 1))
> > > 
> > > should be "err >= 0" rather than "!err".  That could result in a
> > > use-after free, which can make anything explode.
> > > If not too much trouble, could you just tweek that line and see what
> > > happens?
> > 
> > Like the following?  Same divide-by-zero, I'm afraid.
> 
> Hm, playing with reproducer; it takes more than one mount.  My simplest
> reproducer is:
> 
> 	mount -overs=3 server:/path /mnt/
> 	umount /mnt/
> 	mount -overs=4.0 server:/path /mnt/
> 
> ... and the client crashes here.

Also: the problem starts with the last patch ("lockd: use
svc_set_num_threads() for thread start and stop").

--b.

  reply	other threads:[~2021-11-22 15:18 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17  0:46 [PATCH 00/14] SUNRPC: clean up server thread management NeilBrown
2021-11-17  0:46 ` [PATCH 10/14] lockd: move lockd_start_svc() call into lockd_create_svc() NeilBrown
2021-11-17  0:46 ` [PATCH 13/14] lockd: rename lockd_create_svc() to lockd_get() NeilBrown
2021-11-17  0:46 ` [PATCH 03/14] NFSD: narrow nfsd_mutex protection in nfsd thread NeilBrown
2021-11-17  0:46 ` [PATCH 05/14] NFSD: Make it possible to use svc_set_num_threads_sync NeilBrown
2021-11-17  0:46 ` [PATCH 04/14] SUNRPC: use sv_lock to protect updates to sv_nrthreads NeilBrown
2021-11-17  0:46 ` [PATCH 12/14] lockd: introduce lockd_put() NeilBrown
2021-11-17  0:46 ` [PATCH 08/14] lockd: introduce nlmsvc_serv NeilBrown
2021-11-17  0:46 ` [PATCH 07/14] NFSD: simplify locking for network notifier NeilBrown
2021-11-17  0:46 ` [PATCH 09/14] lockd: simplify management of network status notifiers NeilBrown
2021-11-17  0:46 ` [PATCH 02/14] nfsd: make nfsd_stats.th_cnt atomic_t NeilBrown
2021-11-17  0:46 ` [PATCH 14/14] lockd: use svc_set_num_threads() for thread start and stop NeilBrown
2021-11-17  0:46 ` [PATCH 01/14] SUNRPC: stop using ->sv_nrthreads as a refcount NeilBrown
2021-11-17  0:46 ` [PATCH 11/14] lockd: move svc_exit_thread() into the thread NeilBrown
2021-11-17  0:46 ` [PATCH 06/14] SUNRPC: discard svo_setup and rename svc_set_num_threads_sync() NeilBrown
2021-11-17 14:12 ` [PATCH 00/14] SUNRPC: clean up server thread management J. Bruce Fields
2021-11-19  3:24   ` NeilBrown
2021-11-21 23:50   ` NeilBrown
2021-11-22  0:56     ` J. Bruce Fields
2021-11-22  0:59       ` J. Bruce Fields
2021-11-22  1:13         ` NeilBrown
2021-11-22  2:37           ` J. Bruce Fields
2021-11-22  3:38             ` J. Bruce Fields
2021-11-22 15:18               ` J. Bruce Fields [this message]
2021-11-22 23:25                 ` NeilBrown
2021-11-17 17:12 ` Chuck Lever III
2021-11-19  3:19   ` 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=20211122151823.GA22802@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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.