]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xfs: Non-blocking inode locking in IO completion
authorDave Chinner <david@fromorbit.com>
Wed, 17 Feb 2010 05:36:29 +0000 (05:36 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:48:02 +0000 (07:48 -0700)
commit30cd163f7c089175033d643bcd475c552926fbbf
tree84c8711a436d7a3be5c09adadde103409865e46d
parentc4b78d3de51f5acdcf328719c79259e465d16e61
xfs: Non-blocking inode locking in IO completion

commit 77d7a0c2eeb285c9069e15396703d0cb9690ac50 upstream.

The introduction of barriers to loop devices has created a new IO
order completion dependency that XFS does not handle. The loop
device implements barriers using fsync and so turns a log IO in the
XFS filesystem on the loop device into a data IO in the backing
filesystem. That is, the completion of log IOs in the loop
filesystem are now dependent on completion of data IO in the backing
filesystem.

This can cause deadlocks when a flush daemon issues a log force with
an inode locked because the IO completion of IO on the inode is
blocked by the inode lock. This in turn prevents further data IO
completion from occuring on all XFS filesystems on that CPU (due to
the shared nature of the completion queues). This then prevents the
log IO from completing because the log is waiting for data IO
completion as well.

The fix for this new completion order dependency issue is to make
the IO completion inode locking non-blocking. If the inode lock
can't be grabbed, simply requeue the IO completion back to the work
queue so that it can be processed later. This prevents the
completion queue from being blocked and allows data IO completion on
other inodes to proceed, hence avoiding completion order dependent
deadlocks.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/xfs/linux-2.6/xfs_aops.c