NFS-AIO-doesn-t-require-revert-iterator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




From 58d1c971b2d42871441e887e3ec4a5a21c83aa95 Mon Sep 17 00:00:00 2001
From: liuh <liuhuan01@xxxxxxxxxx>
Date: Mon, 24 Jun 2024 17:49:08 +0800
Subject: [PATCH] NFS: AIO doesn't require revert iterator

For AIO, nfs_direct_wait return -EIOCBQUEUED would be excepted.
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 bb2f583eb..262769dae 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -471,7 +471,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;
 	}
@@ -1030,7 +1031,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


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux