diff mbox series

NFS: AIO doesn't require revert iterator

Message ID 20240704004002.5787-1-liuhuan01@kylinos.cn (mailing list archive)
State New
Headers show
Series NFS: AIO doesn't require revert iterator | expand

Commit Message

liuh July 4, 2024, 12:40 a.m. UTC
For AIO, nfs_direct_wait return -EIOCBQUEUED would be expected.
Revert iter is redundant.

Signed-off-by: liuh <liuhuan01@kylinos.cn>
---
 fs/nfs/direct.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

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;
 	}