From: "J. Bruce Fields" <bfields@fieldses.org>
To: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: akpm@linux-foundation.org, linux-nfs@vger.kernel.org,
Trond.Myklebust@netapp.com, linux-kernel@vger.kernel.org,
devel@openvz.org
Subject: Re: [PATCH 0/2] NFSD: fix races in service per-net resources allocation
Date: Tue, 12 Feb 2013 15:45:34 -0500 [thread overview]
Message-ID: <20130212204533.GD10267@fieldses.org> (raw)
In-Reply-To: <511A10E0.1000604@parallels.com>
On Tue, Feb 12, 2013 at 01:52:32PM +0400, Stanislav Kinsbursky wrote:
> 12.02.2013 00:58, J. Bruce Fields пишет:
> <snip>
> > void svc_close_net(struct svc_serv *serv, struct net *net)
> > {
> >- svc_close_list(serv, &serv->sv_tempsocks, net);
> >- svc_close_list(serv, &serv->sv_permsocks, net);
> >-
> >- svc_clear_pools(serv, net);
> >- /*
> >- * At this point the sp_sockets lists will stay empty, since
> >- * svc_xprt_enqueue will not add new entries without taking the
> >- * sp_lock and checking XPT_BUSY.
> >- */
> >- svc_clear_list(serv, &serv->sv_tempsocks, net);
> >- svc_clear_list(serv, &serv->sv_permsocks, net);
> >+ int closed;
> >+ int delay = 0;
> >+
> >+again:
> >+ closed = svc_close_list(serv, &serv->sv_permsocks, net);
> >+ closed += svc_close_list(serv, &serv->sv_tempsocks, net);
> >+ if (closed) {
> >+ svc_clean_up_xprts(serv, net);
> >+ msleep(delay++);
> >+ goto again;
> >+ }
>
> Frankly, this hunk above makes me feel sick... :(
> But I have no better idea right now...
> Maybe make this hunk a bit less weird (this is from my POW only, of course), like this:
>
> > + while (svc_close_list(serv, &serv->sv_permsocks, net) +
> > + svc_close_list(serv, &serv->sv_tempsocks, net)) {
> > + svc_clean_up_xprts(serv, net);
> > + msleep(delay++);
> > + }
>
> ?
OK, that's a little more compact at least.
--b.
>
> Anyway, thanks!
>
> Acked-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
>
> --
> Best regards,
> Stanislav Kinsbursky
next prev parent reply other threads:[~2013-02-12 20:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-01 11:28 [PATCH 0/2] NFSD: fix races in service per-net resources allocation Stanislav Kinsbursky
2013-02-01 11:28 ` [PATCH 1/2] per-cpu semaphores: export symbols to modules Stanislav Kinsbursky
2013-02-01 11:28 ` [PATCH 2/2] SUNRPC: protect transport processing with per-cpu rw semaphore Stanislav Kinsbursky
2013-02-11 0:25 ` [PATCH 0/2] NFSD: fix races in service per-net resources allocation J. Bruce Fields
2013-02-11 6:18 ` Stanislav Kinsbursky
2013-02-11 16:37 ` J. Bruce Fields
2013-02-11 20:58 ` J. Bruce Fields
2013-02-12 9:52 ` Stanislav Kinsbursky
2013-02-12 20:45 ` J. Bruce Fields [this message]
2013-02-12 21:18 ` Peter Staubach
2013-02-13 5:16 ` Stanislav Kinsbursky
2013-02-12 6:49 ` Stanislav Kinsbursky
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=20130212204533.GD10267@fieldses.org \
--to=bfields@fieldses.org \
--cc=Trond.Myklebust@netapp.com \
--cc=akpm@linux-foundation.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=skinsbursky@parallels.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