When performing AIO write, the file_modified_flags() function checks whether or not to update inode times. In case update is needed and iocb carries the RWF_NOWAIT flag, the check return EINTR error that quickly propagates into iocb completion without doing any IO. This restriction effectively prevents doing AIO writes with nowait flag, as file modifications really imply time update. However, in the filesystem is mounted with SB_LAZYTIME flag, this restriction can be raised, as updating inode times should happen in a lazy manner, by marking the inode dirty and postponing on-disk updates that may require locking. Signed-off-by: Pavel Emelyanov <xemul@xxxxxxxxxxxx> --- fs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/inode.c b/fs/inode.c index 01ebdc40021e..d65584d25a00 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2369,7 +2369,7 @@ static int file_modified_flags(struct file *file, int flags) ret = inode_needs_update_time(inode); if (ret <= 0) return ret; - if (flags & IOCB_NOWAIT) + if ((flags & IOCB_NOWAIT) && !(inode->i_sb->s_flags & SB_LAZYTIME)) return -EAGAIN; return __file_update_time(file, ret); -- 2.51.0