Re: [PATCH] xfs: don't take the i_mutex in ->fsync()

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

 



On Tue, Jul 19, 2011 at 08:41:33AM -0400, Josef Bacik wrote:
> In pushing down the i_mutex into the ->fsync() handlers I introduced a deadlock
> since xfs will call xfs_file_fsync in the O_SYNC case while still holding the
> i_mutex case.  In talking with Dave he said that xfs doesn't really need to hold
> the i_mutex in xfs_file_sync() so just drop the taking of i_mutex and we should
> be good to go.  Thanks,

We need some serialized around the xfs_ioend_wait call to prvent new
ioends coming in from starving our wait, be that i_mutex or the iolock.

The right fix for you patch for now is fixing xfs_file_aio_write to
call xfs_file_fsync correctly, that is removing the
filemap_write_and_wait_range call, and instead moving the fsync call
into the section where we have dropped the iolock and i_mutex.

Dave and I can then later look into dropping i_mutex in fsync and
replacing it with the iolock and/or finding a way to reduce the number
of lock roundtrips in the O_SYNC path.

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


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux