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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250307233422.658954-1-nphamcs@gmail.com>
Date: Fri,  7 Mar 2025 15:34:22 -0800
From: Nhat Pham <nphamcs@...il.com>
To: akpm@...ux-foundation.org
Cc: hannes@...xchg.org,
	yosryahmed@...gle.com,
	yosry.ahmed@...ux.dev,
	chengming.zhou@...ux.dev,
	linux-mm@...ck.org,
	kernel-team@...a.com,
	linux-kernel@...r.kernel.org
Subject: [PATCH] page_io: return proper error codes for swap_read_folio_zeromap() (fix)

Fix the comments for swap_read_folio_zeromap().

Suggested-by: Yosry Ahmed <yosry.ahmed@...ux.dev>
Signed-off-by: Nhat Pham <nphamcs@...il.com>
---
 mm/page_io.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index 48ed1e810392..30ec132c801b 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -521,9 +521,8 @@ static void sio_read_complete(struct kiocb *iocb, long ret)
  *
  *  -ENOENT: the folio is entirely not zeromapped. The folio remains locked.
  *
- *  -EINVAL: some of the subpages in the folio are zeromaped, but not all of
- *  them. This is an error because we don't currently support a large folio
- *  that is partially in the zeromap. The folio is unlocked, but NOT marked
+ *  -EINVAL: The folio is partially in the zeromap, which is not
+ *  currently supported. The folio is unlocked, but NOT marked
  *  up-to-date, so that an IO error is emitted (e.g. do_swap_page() will
  *  sigbus).
  */
@@ -533,11 +532,6 @@ static int swap_read_folio_zeromap(struct folio *folio)
 	struct obj_cgroup *objcg;
 	bool is_zeromap;
 
-	/*
-	 * Swapping in a large folio that is partially in the zeromap is not
-	 * currently handled. Return -EINVAL without marking the folio uptodate so
-	 * that an IO error is emitted (e.g. do_swap_page() will sigbus).
-	 */
 	if (WARN_ON_ONCE(swap_zeromap_batch(folio->swap, nr_pages,
 			&is_zeromap) != nr_pages)) {
 		folio_unlock(folio);
-- 
2.43.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ