All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: unlisted-recipients:; (no To-header on input)
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jeff Layton <jlayton@redhat.com>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: [PATCH 11/11] mm: Remove filemap_fdatawait_keep_errors()
Date: Mon,  9 Jan 2023 05:18:23 +0000	[thread overview]
Message-ID: <20230109051823.480289-12-willy@infradead.org> (raw)
In-Reply-To: <20230109051823.480289-1-willy@infradead.org>

This function is now the same as filemap_fdatawait(), so change all
callers to use that instead.  Remove the comments which talk about keeping
the errors around for other callers as this is now the only behaviour.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 block/bdev.c            | 8 +-------
 fs/fs-writeback.c       | 7 +------
 fs/xfs/scrub/bmap.c     | 2 +-
 include/linux/pagemap.h | 2 --
 4 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/block/bdev.c b/block/bdev.c
index edc110d90df4..2fae19f0a5c2 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -1053,13 +1053,7 @@ void sync_bdevs(bool wait)
 		if (!atomic_read(&bdev->bd_openers)) {
 			; /* skip */
 		} else if (wait) {
-			/*
-			 * We keep the error status of individual mapping so
-			 * that applications can catch the writeback error using
-			 * fsync(2). See filemap_fdatawait_keep_errors() for
-			 * details.
-			 */
-			filemap_fdatawait_keep_errors(inode->i_mapping);
+			filemap_fdatawait(inode->i_mapping);
 		} else {
 			filemap_fdatawrite(inode->i_mapping);
 		}
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 6fba5a52127b..dc0158125e5d 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -2598,12 +2598,7 @@ static void wait_sb_inodes(struct super_block *sb)
 		spin_unlock(&inode->i_lock);
 		rcu_read_unlock();
 
-		/*
-		 * We keep the error status of individual mapping so that
-		 * applications can catch the writeback error using fsync(2).
-		 * See filemap_fdatawait_keep_errors() for details.
-		 */
-		filemap_fdatawait_keep_errors(mapping);
+		filemap_fdatawait(mapping);
 
 		cond_resched();
 
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index d50d0eab196a..8f169047d410 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -64,7 +64,7 @@ xchk_setup_inode_bmap(
 		 */
 		error = filemap_fdatawrite(mapping);
 		if (!error)
-			error = filemap_fdatawait_keep_errors(mapping);
+			error = filemap_fdatawait(mapping);
 		if (error && (error != -ENOSPC && error != -EIO))
 			goto out;
 	}
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 7fe2a5ec1c12..69190335deb1 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -40,8 +40,6 @@ static inline int filemap_fdatawait(struct address_space *mapping)
 	return filemap_fdatawait_range(mapping, 0, LLONG_MAX);
 }
 
-#define filemap_fdatawait_keep_errors(mapping)	filemap_fdatawait(mapping)
-
 bool filemap_range_has_page(struct address_space *, loff_t lstart, loff_t lend);
 int filemap_write_and_wait_range(struct address_space *mapping,
 		loff_t lstart, loff_t lend);
-- 
2.35.1


WARNING: multiple messages have this Message-ID (diff)
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jeff Layton <jlayton@redhat.com>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: [PATCH 11/11] mm: Remove filemap_fdatawait_keep_errors()
Date: Mon,  9 Jan 2023 05:18:23 +0000	[thread overview]
Message-ID: <20230109051823.480289-12-willy@infradead.org> (raw)
In-Reply-To: <20230109051823.480289-1-willy@infradead.org>

This function is now the same as filemap_fdatawait(), so change all
callers to use that instead.  Remove the comments which talk about keeping
the errors around for other callers as this is now the only behaviour.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 block/bdev.c            | 8 +-------
 fs/fs-writeback.c       | 7 +------
 fs/xfs/scrub/bmap.c     | 2 +-
 include/linux/pagemap.h | 2 --
 4 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/block/bdev.c b/block/bdev.c
index edc110d90df4..2fae19f0a5c2 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -1053,13 +1053,7 @@ void sync_bdevs(bool wait)
 		if (!atomic_read(&bdev->bd_openers)) {
 			; /* skip */
 		} else if (wait) {
-			/*
-			 * We keep the error status of individual mapping so
-			 * that applications can catch the writeback error using
-			 * fsync(2). See filemap_fdatawait_keep_errors() for
-			 * details.
-			 */
-			filemap_fdatawait_keep_errors(inode->i_mapping);
+			filemap_fdatawait(inode->i_mapping);
 		} else {
 			filemap_fdatawrite(inode->i_mapping);
 		}
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 6fba5a52127b..dc0158125e5d 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -2598,12 +2598,7 @@ static void wait_sb_inodes(struct super_block *sb)
 		spin_unlock(&inode->i_lock);
 		rcu_read_unlock();
 
-		/*
-		 * We keep the error status of individual mapping so that
-		 * applications can catch the writeback error using fsync(2).
-		 * See filemap_fdatawait_keep_errors() for details.
-		 */
-		filemap_fdatawait_keep_errors(mapping);
+		filemap_fdatawait(mapping);
 
 		cond_resched();
 
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index d50d0eab196a..8f169047d410 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -64,7 +64,7 @@ xchk_setup_inode_bmap(
 		 */
 		error = filemap_fdatawrite(mapping);
 		if (!error)
-			error = filemap_fdatawait_keep_errors(mapping);
+			error = filemap_fdatawait(mapping);
 		if (error && (error != -ENOSPC && error != -EIO))
 			goto out;
 	}
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 7fe2a5ec1c12..69190335deb1 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -40,8 +40,6 @@ static inline int filemap_fdatawait(struct address_space *mapping)
 	return filemap_fdatawait_range(mapping, 0, LLONG_MAX);
 }
 
-#define filemap_fdatawait_keep_errors(mapping)	filemap_fdatawait(mapping)
-
 bool filemap_range_has_page(struct address_space *, loff_t lstart, loff_t lend);
 int filemap_write_and_wait_range(struct address_space *mapping,
 		loff_t lstart, loff_t lend);
-- 
2.35.1



  parent reply	other threads:[~2023-01-09  5:19 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  5:18 [PATCH 00/11] Remove AS_EIO and AS_ENOSPC Matthew Wilcox (Oracle)
2023-01-09  5:18 ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 01/11] memory-failure: Remove comment referencing AS_EIO Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-12  8:31   ` Christoph Hellwig
2023-01-09  5:18 ` [PATCH 02/11] filemap: Remove filemap_check_and_keep_errors() Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09 13:48   ` Jeff Layton
2023-01-09 14:02     ` Matthew Wilcox
2023-01-09 14:31       ` Jeff Layton
2023-01-09 15:02         ` Matthew Wilcox
2023-01-09  5:18 ` [PATCH 03/11] f2fs: Convert f2fs_wait_on_node_pages_writeback() to errseq Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 04/11] fuse: Convert fuse_flush() to use file_check_and_advance_wb_err() Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09 15:25   ` Jeff Layton
2023-01-09  5:18 ` [PATCH 05/11] page-writeback: Convert folio_write_one() to use an errseq Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 06/11] filemap: Convert filemap_write_and_wait_range() to use errseq Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-17  2:55   ` kernel test robot
2023-01-09  5:18 ` [PATCH 07/11] filemap: Convert filemap_fdatawait_range() to errseq Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 08/11] cifs: Remove call to filemap_check_wb_err() Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09 14:42   ` Jeff Layton
2023-01-09 15:07     ` Matthew Wilcox
2023-01-09 15:14     ` Jeff Layton
2023-01-09 15:30       ` Matthew Wilcox
2023-01-09 15:43         ` Jeff Layton
2023-01-09  5:18 ` [PATCH 09/11] mm: Remove AS_EIO and AS_ENOSPC Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 10/11] mm: Remove filemap_fdatawait_range_keep_errors() Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` Matthew Wilcox (Oracle) [this message]
2023-01-09  5:18   ` [PATCH 11/11] mm: Remove filemap_fdatawait_keep_errors() Matthew Wilcox (Oracle)
2023-01-09 15:31 ` [PATCH 00/11] Remove AS_EIO and AS_ENOSPC Jeff Layton
2023-01-12  8:30 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230109051823.480289-12-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=hch@lst.de \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.