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]
Message-ID: <578E7A79.7080003@hpe.com>
Date:	Tue, 19 Jul 2016 15:07:37 -0400
From:	Waiman Long <waiman.long@....com>
To:	Al Viro <viro@...IV.linux.org.uk>
CC:	Jan Kara <jack@...e.com>, Jeff Layton <jlayton@...chiereds.net>,
	"J. Bruce Fields" <bfields@...ldses.org>,
	Tejun Heo <tj@...nel.org>,
	Christoph Lameter <cl@...ux-foundation.org>,
	<linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Andi Kleen <andi@...stfloor.org>,
	Dave Chinner <dchinner@...hat.com>,
	Boqun Feng <boqun.feng@...il.com>,
	Scott J Norton <scott.norton@....com>,
	Douglas Hatch <doug.hatch@....com>
Subject: Re: [PATCH v3 4/4] vfs: Use dlock list for superblock's inode list

On 07/19/2016 01:23 AM, Al Viro wrote:
> On Fri, Jul 15, 2016 at 01:39:43PM -0400, Waiman Long wrote:
>>   void iterate_bdevs(void (*func)(struct block_device *, void *), void *arg)
>>   {
>>   	struct inode *inode, *old_inode = NULL;
>> +	DEFINE_DLOCK_LIST_ITER(iter);
>>
>> -	spin_lock(&blockdev_superblock->s_inode_list_lock);
>> -	list_for_each_entry(inode,&blockdev_superblock->s_inodes, i_sb_list) {
>> -		struct address_space *mapping = inode->i_mapping;
>> +	while (dlock_list_next(&blockdev_superblock->s_inodes,&iter)) {
>> +		struct address_space *mapping;
>>
>> +		inode   = list_entry(iter.curr, struct inode, i_sb_list);
>> +		mapping = inode->i_mapping;
> TBH, I would very much prefer something like
> 	DEFINE_DLOCK_LIST_ITER(iter,&blockdev_superblock->s_inodes);
>
> 	dlist_for_each_entry(inode,&iter, i_sb_list) {
> 		mapping = inode->i_mapping;
>

Sure. I will make the necessary changes to make it happen. Thanks for 
the suggestion.

>> -		spin_unlock(&blockdev_superblock->s_inode_list_lock);
>> +		spin_unlock(iter.lock);
> ... and this might be worth dlist_{un,re}lock(&iter);

Good point. Will change the code accordingly.

Cheers,
Longman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ