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:	Fri, 05 Oct 2012 17:53:36 +0400
From:	Dmitry Monakhov <dmonakhov@...nvz.org>
To:	Theodore Ts'o <tytso@....edu>
Cc:	linux-ext4@...r.kernel.org, jack@...e.cz
Subject: Re: [PATCH] ext4: fix ext4_flush_completed_IO wait semantics

On Fri, 5 Oct 2012 09:28:53 -0400, Theodore Ts'o <tytso@....edu> wrote:
> On Fri, Oct 05, 2012 at 05:01:30PM +0400, Dmitry Monakhov wrote:
> > > This WARN_ON is triggering on the truncate path...
> > Yeap, this is false positive one. We skip i_mutex on ext4_evict_inode
> > This is strange xfsstress 269'th should caught that for me.
> > I'll try to prepare workaround ASAP.
> 
> This is the patch which I'm currently testing.  If it passes I'll fold
> it into your patch.  Anyone see any problems with it?
> 
>    	     	     	       	    	     - Ted
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index f18e786..cd171dd 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -238,8 +238,10 @@ void ext4_evict_inode(struct inode *inode)
>  	 * protection against it
>  	 */
>  	sb_start_intwrite(inode->i_sb);
> +	mutex_lock(&inode->i_mutex);
>  	handle = ext4_journal_start(inode, ext4_blocks_for_truncate(inode)+3);
>  	if (IS_ERR(handle)) {
> +		mutex_unlock(&inode->i_mutex);
I mutex is not needed for journal start.
>  		ext4_std_error(inode->i_sb, PTR_ERR(handle));
>  		/*
>  		 * If we're going to skip the normal cleanup, we still need to
> @@ -256,12 +258,14 @@ void ext4_evict_inode(struct inode *inode)
>  	inode->i_size = 0;
>  	err = ext4_mark_inode_dirty(handle, inode);
>  	if (err) {
> +		mutex_unlock(&inode->i_mutex);
>  		ext4_warning(inode->i_sb,
>  			     "couldn't mark inode dirty (err %d)", err);
>  		goto stop_handle;
>  	}
>  	if (inode->i_blocks)
>  		ext4_truncate(inode);
> +	mutex_unlock(&inode->i_mutex);
Jiaying Zhang removed i_mutex from ext4_evict_inode here 8c0bec2151
because of false positive lockdep complains.
Let's just learn warning about evict_inode 

View attachment "0001-ext4-fix-false-positive-warning-ext4_evict_inode.patch" of type "text/x-patch" (880 bytes)

Powered by blists - more mailing lists