lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240704004002.5787-1-liuhuan01@kylinos.cn>
Date: Thu,  4 Jul 2024 08:40:02 +0800
From: liuh <liuhuan01@...inos.cn>
To: trondmy@...nel.org,
	anna@...nel.org
Cc: linux-nfs@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	liuh <liuhuan01@...inos.cn>
Subject: [PATCH] NFS: AIO doesn't require revert iterator

For AIO, nfs_direct_wait return -EIOCBQUEUED would be expected.
Revert iter is redundant.

Signed-off-by: liuh <liuhuan01@...inos.cn>
---
 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ