[Top] [All Lists]

[PATCH 0/2] splice: i_mutex vs splice write deadlock

To: linux-fsdevel@xxxxxxxxxxxxxxx
Subject: [PATCH 0/2] splice: i_mutex vs splice write deadlock
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 18 Jul 2011 14:04:42 +1000
Cc: linux-kernel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
generic_file_splice_write() takes the inode->i_mutex after the
filesystem has taken whatever locks it needs to ensure sanity.
however, this typically violates the locking order of filesystems
with their own locks in that the order is usually i_mutex ->
filesystem lock.

XFS is such a case, and generic_file_splice_write() is generating
lockdep warnings because of lock inversions between the
inode->i_mutex and the XFS_I(inode)->i_iolock. There is also a
reported case of fio causing a deadlock when it mixes IO types
(e.g. splice vs direct IO).

This patch set introduces generic_file_splice_write_unlocked() and
factors the code such that __generic_file_splice_write() will only
lock the i_mutex if called from the locked variant. The second patch
modifies XFS to use the new function.

<Prev in Thread] Current Thread [Next in Thread>