Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1614270 > unrolled thread

[RFC PATCH 3/4] buffer: set wb errors using both new and old infrastructure for now

Started byJeff Layton <jlayton@redhat.com>
First post2017-03-31 21:30 +0200
Last post2017-03-31 21:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC PATCH 3/4] buffer: set wb errors using both new and old infrastructure for now Jeff Layton <jlayton@redhat.com> - 2017-03-31 21:30 +0200

#1614270 — [RFC PATCH 3/4] buffer: set wb errors using both new and old infrastructure for now

FromJeff Layton <jlayton@redhat.com>
Date2017-03-31 21:30 +0200
Subject[RFC PATCH 3/4] buffer: set wb errors using both new and old infrastructure for now
Message-ID<trapb-nk-3@gated-at.bofh.it>
In later patches, we'll be converting filesystems over to use the new
filemap_*_wb_error API for storing and reporting writeback errors.

Since several different filesystems use the code in buffer.c, ensure
that we report errors using both schemes for now. Eventually we
should be able to remove the mapping_set_error calls once nothing
relies on it.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/buffer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 9196f2a270da..5dde6de2408f 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -354,6 +354,7 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate)
 	} else {
 		buffer_io_error(bh, ", lost async page write");
 		mapping_set_error(page->mapping, -EIO);
+		filemap_set_wb_error(page->mapping, -EIO);
 		set_buffer_write_io_error(bh);
 		clear_buffer_uptodate(bh);
 		SetPageError(page);
@@ -1879,6 +1880,7 @@ int __block_write_full_page(struct inode *inode, struct page *page,
 	SetPageError(page);
 	BUG_ON(PageWriteback(page));
 	mapping_set_error(page->mapping, err);
+	filemap_set_wb_error(page->mapping, err);
 	set_page_writeback(page);
 	do {
 		struct buffer_head *next = bh->b_this_page;
@@ -3291,8 +3293,10 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
 
 	bh = head;
 	do {
-		if (buffer_write_io_error(bh) && page->mapping)
+		if (buffer_write_io_error(bh) && page->mapping) {
 			mapping_set_error(page->mapping, -EIO);
+			filemap_set_wb_error(page->mapping, -EIO);
+		}
 		if (buffer_busy(bh))
 			goto failed;
 		bh = bh->b_this_page;
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web