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] [thread-next>] [day] [month] [year] [list]
Date: Mon, 12 Feb 2024 08:13:35 +0100
From: Christoph Hellwig <hch@....de>
To: linux-mm@...ck.org
Cc: Matthew Wilcox <willy@...radead.org>,
	Jan Kara <jack@...e.com>,
	David Howells <dhowells@...hat.com>,
	Brian Foster <bfoster@...hat.com>,
	Christian Brauner <brauner@...nel.org>,
	linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 01/14] writeback: don't call mapping_set_error in writepage_cb

writepage_cb is the iterator callback for write_cache_pages, which
already tracks all errors and returns them to the caller.  There is
no need to additionally cal mapping_set_error which is intended
for contexts where the error can't be directly returned (e.g. the
I/O completion handlers).

Remove the mapping_set_error call in writepage_cb which is not only
superfluous but also buggy as it can be called with the error argument
set to AOP_WRITEPAGE_ACTIVATE, which is not actually an error but a
magic return value asking the caller to unlock the page.

Signed-off-by: Christoph Hellwig <hch@....de>
---
 mm/page-writeback.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 3f255534986a2f..62901fa905f01e 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2534,9 +2534,8 @@ static int writepage_cb(struct folio *folio, struct writeback_control *wbc,
 		void *data)
 {
 	struct address_space *mapping = data;
-	int ret = mapping->a_ops->writepage(&folio->page, wbc);
-	mapping_set_error(mapping, ret);
-	return ret;
+
+	return mapping->a_ops->writepage(&folio->page, wbc);
 }
 
 int do_writepages(struct address_space *mapping, struct writeback_control *wbc)
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ