[PATCH 2/2] xfs: fix splice/direct-IO deadlock
Christoph Hellwig
hch at infradead.org
Wed Aug 10 05:17:33 CDT 2011
On Mon, Aug 08, 2011 at 04:45:27PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner at redhat.com>
>
> lockdep reports splice vs direct-io write lock inversions due to
> generic_file_splice_write() taking the inode->i_mutex inside
> XFS_IOLOCK_EXCL context. These lock contexts are inverted, hence can
> deadlock. Use splice_write_to_file() with an actor that does not
> take the i_mutex to avoid these problems.
I don't think the locking model is quite correct yet. We'll still
hold the iolock and i_mutex over
splice_from_pipe_begin/splice_from_pipe_next/splice_from_pipe_end,
which call into the pipe code, and take other i_mutex instances that
may deadlock against ours.
It also means we hold the iolock over generic_write_sync which calls
into ->fsync which takes the iolock with my latests changes.
I think we'll have to take the locking and i_size updates into the
actor, and behave like the other filesystems.
More information about the xfs
mailing list