lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <511B2190.2050006@parallels.com>
Date:	Wed, 13 Feb 2013 09:16:00 +0400
From:	Stanislav Kinsbursky <skinsbursky@...allels.com>
To:	Peter Staubach <pstaubach@...grid.com>
CC:	"J. Bruce Fields" <bfields@...ldses.org>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"linux-nfs@...r.kernel.org" <linux-nfs@...r.kernel.org>,
	"Trond.Myklebust@...app.com" <Trond.Myklebust@...app.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devel@...nvz.org" <devel@...nvz.org>
Subject: Re: [PATCH 0/2] NFSD: fix races in service per-net resources allocation

13.02.2013 01:18, Peter Staubach пишет:
> The "+" thing seems a little odd.  Why not use "||" instead?  The sum of the two returns isn't really the important thing, is it?  It is that either call to svc_close_list() returns non-zero.
>
> 	Thanx...
>

Yep, thanks for the notice.

> 		ps
>
>
> -----Original Message-----
> From: linux-nfs-owner@...r.kernel.org [mailto:linux-nfs-owner@...r.kernel.org] On Behalf Of J. Bruce Fields
> Sent: Tuesday, February 12, 2013 3:46 PM
> To: Stanislav Kinsbursky
> Cc: akpm@...ux-foundation.org; linux-nfs@...r.kernel.org; Trond.Myklebust@...app.com; linux-kernel@...r.kernel.org; devel@...nvz.org
> Subject: Re: [PATCH 0/2] NFSD: fix races in service per-net resources allocation
>
> 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@...allels.com>
>>
>> --
>> Best regards,
>> Stanislav Kinsbursky
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@...r.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
Best regards,
Stanislav Kinsbursky
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ