RE: [PATCH 1/2] ext4: introduce new i_write_mutex to protect fallocate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Mon, May 26, 2014 at 12:29:00PM -0400, Theodore Ts'o wrote:
> > On Tue, May 13, 2014 at 09:19:17AM +0900, Namjae Jeon wrote:
> > > Introduce new i_write_mutex to protect new writes from coming while doing
> > > fallocate operations. Also, get rid of aio_mutex as it is covered by
> > > i_write_mutex.
> > >
> > Thanks, applied.
> >
> 
> I had to apply the following fix up patch, or else running generic/308
> using the ext3 config would end up returning to userspace with
> i_write_mutex still locked.
> 
> For all ext4 developers: please consider running at least
> "kvm-xfstests -g quick" (which would have shown this issue), or better
> yet, "kvm-xfstests -g auto" before sending patches.  It finds problems
> like this.  :-)
Hi Ted.

Sorry for my mistake... I will carefully test it next time. :)

Thanks a lot!!
> 
> Cheers,
> 
> 					- Ted
> 
> diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> index 8c39305..e5cd87f 100644
> --- a/fs/ext4/file.c
> +++ b/fs/ext4/file.c
> @@ -135,8 +135,8 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
>  		if ((pos > sbi->s_bitmap_maxbytes) ||
>  		    (pos == sbi->s_bitmap_maxbytes && length > 0)) {
>  			mutex_unlock(&inode->i_mutex);
> -			ret = -EFBIG;
> -			goto errout;
> +			mutex_unlock(&EXT4_I(inode)->i_write_mutex);
> +			return -EFBIG;
>  		}
> 
>  		if (pos + length > sbi->s_bitmap_maxbytes) {
> @@ -196,7 +196,6 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
>  	if (o_direct)
>  		blk_finish_plug(&plug);
> 
> -errout:
>  	if (unaligned_direct_aio)
>  		mutex_unlock(&EXT4_I(inode)->i_write_mutex);
>  	return ret;

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux