• Dave Chinner's avatar
    xfs: direct IO EOF zeroing needs to drain AIO · 40c63fbc
    Dave Chinner authored
    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: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    40c63fbc
xfs_file.c 37 KB