xfs: direct IO EOF zeroing needs to drain AIO
authorDave Chinner <dchinner@redhat.com>
Thu, 16 Apr 2015 12:03:17 +0000 (22:03 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 16 Apr 2015 12:03:17 +0000 (22:03 +1000)
commit40c63fbc55a968383b8bb5cacad81585e80cd323
tree0cfdfc602b33218142eddc75d3642bbc06a3bcd5
parentb9d59846f73713d77f0f3fb784c7f84249fc2b93
xfs: direct IO EOF zeroing needs to drain AIO

When we are doing AIO DIO writes, the IOLOCK only provides an IO
submission barrier. When we need to do EOF zeroing, we need to ensure
that no other IO is in progress and all pending in-core EOF updates
have been completed. This requires us to wait for all outstanding
AIO DIO writes to the inode to complete and, if necessary, run their
EOF updates.

Once all the EOF updates are complete, we can then restart
xfs_file_aio_write_checks() while holding the IOLOCK_EXCL, knowing
that EOF is up to date and we have exclusive IO access to the file
so we can run EOF block zeroing if we need to without interference.
This gives EOF zeroing the same exclusivity against other IO as we
provide truncate operations.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_file.c
This page took 0.024512 seconds and 5 git commands to generate.