kiocb_modified() should be used for sync/async buffered write because it will return -EAGAIN when IOCB_NOWAIT is set. Unfortunately, kiocb_modified() is used by the common xfs_file_write_checks() which is called by all types of write(i.e. buffered/direct/dax write). This issue makes generic/471 with xfs always get the following error: -------------------------------------------------------- QA output created by 471 pwrite: Resource temporarily unavailable wrote 8388608/8388608 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) pwrite: Resource temporarily unavailable ... -------------------------------------------------------- Fixes: 1aa91d9c9933 ("xfs: Add async buffered write support") Signed-off-by: Xiao Yang <yangx.jy@xxxxxxxxxxx> --- fs/xfs/xfs_file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index e462d39c840e..561fab3a49c7 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -417,6 +417,9 @@ xfs_file_write_checks( spin_unlock(&ip->i_flags_lock); out: + if (IS_DAX(inode) || (iocb->ki_flags & IOCB_DIRECT)) + return file_modified(file); + return kiocb_modified(iocb); } -- 2.21.0