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, 19 Oct 2010 12:16:51 +0200
From:	Boaz Harrosh <bharrosh@...asas.com>
To:	npiggin@...nel.dk
CC:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [patch 08/35] fs: icache lock i_count

On 10/19/2010 05:42 AM, npiggin@...nel.dk wrote:
> Protect inode->i_count with i_lock, rather than having it atomic.
> 
> Signed-off-by: Nick Piggin <npiggin@...nel.dk>
> 
> ---
<>
>  fs/exofs/inode.c                         |   12 +++++++---
>  fs/exofs/namei.c                         |    4 ++-
<>
> Index: linux-2.6/fs/exofs/inode.c
> ===================================================================
> --- linux-2.6.orig/fs/exofs/inode.c	2010-10-19 14:17:26.000000000 +1100
> +++ linux-2.6/fs/exofs/inode.c	2010-10-19 14:19:18.000000000 +1100
> @@ -1107,7 +1107,9 @@
>  

Hi Nick, Please use -p option in your diff(s) it is a bit hard to follow
and review without the proper function context. These patches are on a git
tree. Why don't you use git to produce and send these patches?

>  	set_obj_created(oi);
>  
> -	atomic_dec(&inode->i_count);
> +	spin_lock(&inode->i_lock);
> +	inode->i_count--;
> +	spin_unlock(&inode->i_lock);

I've queued up a patch in Linux-next that will conflict with this.
The patch uses iput() instead.

>  	wake_up(&oi->i_wq);
>  }
>  
> @@ -1160,14 +1162,18 @@
>  	/* increment the refcount so that the inode will still be around when we
>  	 * reach the callback
>  	 */
> -	atomic_inc(&inode->i_count);
> +	spin_lock(&inode->i_lock);
> +	inode->i_count++;
> +	spin_unlock(&inode->i_lock);
>  
>  	ios->done = create_done;
>  	ios->private = inode;
>  	ios->cred = oi->i_cred;
>  	ret = exofs_sbi_create(ios);
>  	if (ret) {
> -		atomic_dec(&inode->i_count);
> +		spin_lock(&inode->i_lock);
> +		inode->i_count--;
> +		spin_unlock(&inode->i_lock);

Here too. (iput)

>  		exofs_put_io_state(ios);
>  		return ERR_PTR(ret);
>  	}
> Index: linux-2.6/fs/exofs/namei.c
> ===================================================================
> --- linux-2.6.orig/fs/exofs/namei.c	2010-10-19 14:17:26.000000000 +1100
> +++ linux-2.6/fs/exofs/namei.c	2010-10-19 14:19:18.000000000 +1100
> @@ -153,7 +153,9 @@
>  
>  	inode->i_ctime = CURRENT_TIME;
>  	inode_inc_link_count(inode);
> -	atomic_inc(&inode->i_count);
> +	spin_lock(&inode->i_lock);
> +	inode->i_count++;

All these will change to inode_get(), right?

> +	spin_unlock(&inode->i_lock);
>  
>  	return exofs_add_nondir(dentry, inode);
>  }

Thanks
Boaz
--
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