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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 18 May 2010 17:23:20 +0200
From:	Tejun Heo <tj@...nel.org>
To:	Imre Deak <imre.deak@...ia.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Eric Paris <eparis@...hat.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] idr: fix backtrack logic in idr_remove_all

On 05/18/2010 01:18 PM, Imre Deak wrote:
>> Shouldn't this be id ^ bt_mask?  The above only detects 1 -> 0
>> transitions not the other way around.
> 
> It works according to the following with n=1:
> 
> id            id+2            fls((id+2) & ~id)
> 0             2               2
> 2             4               3
> 4             6               2
> 6             8               4
> 8             10              2
> 10            12              3
> 12            14              2
> 
> I think this should work.

Ah, I thought you were doing fls(id & ~(id + 2)) and thus looking at 1
-> 0 transitions.  It's the other way and you're looking for the
highest 0 -> 1 transition which should be the same to the highest bit
changing if you aren't overflowing.  The patch looks good then.  I
still think ^ test would be clearer tho.  Hmmm... Can you please add
little comment there stating that you're looking for the highest bit
flipping?

Reviewed-by: Tejun Heo <tj@...nel.org>

Thanks.

-- 
tejun
--
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