This patchset addresses the deeper problems Brian outlined in the
description of this patch:
The basic issues is that DIO completion can run in interrupt context
and it does things it should not do in interrupt context because Bad
Things Will Happen.
Patches 1 and 2 convert the DIO write completion code to use an
ioend and to never run in interrupt context when a transaction or
EOF update may need to be run.
Patches 3 and 4 of this series are effectively the same as the patch
Brain sent, but by checking the ioend status in the completion
routine before taking the spinlock, we can guarantee we never take
the spinlock in interrupt context and hence don't need irq safe spin
locks and so can re-use an existing innermost spinlock for
The final patch is a removal of redundant operations - most of
generic_file_direct_write is being done in the XFS code, so most of
the gneric function is redundant and unnecessary overhead. Hence it
moves the bits that we need into the XFS code path, and we stop
calling the generic code altogether.
This passes xfstests and everything I've thrown at it. There's a
couple of small cleanups that I think still need to be done, but
they are minor. e.g. xfs_end_io_dio_write() can now probably call
xfs_finish_endio_sync() directly now, rather than open coding the
calls it makes after updating the incore inode size....