For AIO, nfs_direct_wait return -EIOCBQUEUED would be expected. Revert iter is redundant. Signed-off-by: liuh <liuhuan01@xxxxxxxxxx> --- fs/nfs/direct.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 90079ca13..1483f1965 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -469,7 +469,8 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter, requested -= result; iocb->ki_pos += result; } - iov_iter_revert(iter, requested); + if (is_sync_kiocb(iocb)) + iov_iter_revert(iter, requested); } else { result = requested; } @@ -1028,7 +1029,8 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter, /* XXX: should check the generic_write_sync retval */ generic_write_sync(iocb, result); } - iov_iter_revert(iter, requested); + if (is_sync_kiocb(iocb)) + iov_iter_revert(iter, requested); } else { result = requested; } -- 2.27.0