linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: per-net rpc shutdown
Date: Thu, 10 May 2012 00:52:46 +0400	[thread overview]
Message-ID: <4FAAD91E.3090606@parallels.com> (raw)
In-Reply-To: <20120509142617.GA24233@fieldses.org>

09.05.2012 18:26, J. Bruce Fields написал:
> Reviewing your more recent patches I think we have a problem with some
> of the code that's already merged.  See the comment in svc_shutdown_net:
>
> 	void svc_shutdown_net(struct svc_serv *serv, struct net *net)
> 	{
> 		/*
> 		 * The set of xprts (contained in the sv_tempsocks and
> 		 * sv_permsocks lists) is now constant, since it is modified
> 		 * only by accepting new sockets (done by service threads in
> 		 * svc_recv) or aging old ones (done by sv_temptimer), or
> 		 * configuration changes (excluded by whatever locking the
> 		 * caller is using--nfsd_mutex in the case of nfsd).  So it's
> 		 * safe to traverse those lists and shut everything down:
> 		 */
> 		svc_close_net(serv, net);
> 	
> 		if (serv->sv_shutdown)
> 			serv->sv_shutdown(serv, net);
> 	}
>
> So we depend on the fact that neither the server threads nor
> sv_temptimer are running here to be able to safely traverse those lists
> of sockets.
>
> But it looks to me like that's no longer true--we're shutting down just
> one namespace here, and others may still be running.  If so and if they
> modify sv_tempsocks or sv_permsocks while we're running through them
> then we're going to get a crash.

Yes, you right. Thanks. I missed this.
You made some changes prior to my patches, which allowed to remove 
locking on these lists,if i'm not mistaken.
Anyway, read-write lock should be enough here, I suppose (I don't have 
sources right now to investigate) ?


      parent reply	other threads:[~2012-05-09 20:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 14:26 per-net rpc shutdown J. Bruce Fields
2012-05-09 14:35 ` J. Bruce Fields
2012-05-09 21:02   ` Stanislav Kinsbursky
2012-05-11 11:41   ` [RFC PATCH] SUNRPC: protect service sockets lists during per-net shutdown Stanislav Kinsbursky
2012-05-16 16:34     ` J. Bruce Fields
2012-05-21  8:51     ` [RFC PATCH v2] " Stanislav Kinsbursky
2012-05-09 20:52 ` Stanislav Kinsbursky [this message]

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=4FAAD91E.3090606@parallels.com \
    --to=skinsbursky@parallels.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).