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

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

 



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,

Signed-off-by: Josef Bacik <josef@xxxxxxxxxx>
---
 fs/xfs/linux-2.6/xfs_file.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 9183f75..b928cb5 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -144,12 +144,8 @@ xfs_file_fsync(
 	if (error)
 		return error;
 
-	mutex_lock(&inode->i_mutex);
-
-	if (XFS_FORCED_SHUTDOWN(mp)) {
-		mutex_unlock(&inode->i_mutex);
+	if (XFS_FORCED_SHUTDOWN(mp))
 		return -XFS_ERROR(EIO);
-	}
 
 	xfs_iflags_clear(ip, XFS_ITRUNCATED);
 
@@ -205,7 +201,6 @@ xfs_file_fsync(
 				XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0);
 		if (error) {
 			xfs_trans_cancel(tp, 0);
-			mutex_unlock(&inode->i_mutex);
 			return -error;
 		}
 		xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -255,7 +250,6 @@ xfs_file_fsync(
 	    !log_flushed)
 		xfs_blkdev_issue_flush(mp->m_ddev_targp);
 
-	mutex_unlock(&inode->i_mutex);
 	return -error;
 }
 
-- 
1.7.5.2

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