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]
Message-Id: <20230109051823.480289-3-willy@infradead.org>
Date:   Mon,  9 Jan 2023 05:18:14 +0000
From:   "Matthew Wilcox (Oracle)" <willy@...radead.org>
To:     unlisted-recipients:; (no To-header on input)
Cc:     "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        Jeff Layton <jlayton@...hat.com>,
        linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>
Subject: [PATCH 02/11] filemap: Remove filemap_check_and_keep_errors()

Convert both callers to use the "new" errseq infrastructure.

Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
 mm/filemap.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index c4d4ace9cc70..48daedc224d9 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -355,16 +355,6 @@ int filemap_check_errors(struct address_space *mapping)
 }
 EXPORT_SYMBOL(filemap_check_errors);
 
-static int filemap_check_and_keep_errors(struct address_space *mapping)
-{
-	/* Check for outstanding write errors */
-	if (test_bit(AS_EIO, &mapping->flags))
-		return -EIO;
-	if (test_bit(AS_ENOSPC, &mapping->flags))
-		return -ENOSPC;
-	return 0;
-}
-
 /**
  * filemap_fdatawrite_wbc - start writeback on mapping dirty pages in range
  * @mapping:	address space structure to write
@@ -567,8 +557,10 @@ EXPORT_SYMBOL(filemap_fdatawait_range);
 int filemap_fdatawait_range_keep_errors(struct address_space *mapping,
 		loff_t start_byte, loff_t end_byte)
 {
+	errseq_t since = filemap_sample_wb_err(mapping);
+
 	__filemap_fdatawait_range(mapping, start_byte, end_byte);
-	return filemap_check_and_keep_errors(mapping);
+	return filemap_check_wb_err(mapping, since);
 }
 EXPORT_SYMBOL(filemap_fdatawait_range_keep_errors);
 
@@ -613,8 +605,10 @@ EXPORT_SYMBOL(file_fdatawait_range);
  */
 int filemap_fdatawait_keep_errors(struct address_space *mapping)
 {
+	errseq_t since = filemap_sample_wb_err(mapping);
+
 	__filemap_fdatawait_range(mapping, 0, LLONG_MAX);
-	return filemap_check_and_keep_errors(mapping);
+	return filemap_check_wb_err(mapping, since);
 }
 EXPORT_SYMBOL(filemap_fdatawait_keep_errors);
 
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ