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


Groups > linux.kernel > #1595355 > unrolled thread

[PATCH v2 7/9] mm: ensure that we set mapping error if writeout() fails

Started byJeff Layton <jlayton@redhat.com>
First post2017-03-08 17:40 +0100
Last post2017-03-08 17:40 +0100
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

  [PATCH v2 7/9] mm: ensure that we set mapping error if writeout() fails Jeff Layton <jlayton@redhat.com> - 2017-03-08 17:40 +0100

#1595355 — [PATCH v2 7/9] mm: ensure that we set mapping error if writeout() fails

FromJeff Layton <jlayton@redhat.com>
Date2017-03-08 17:40 +0100
Subject[PATCH v2 7/9] mm: ensure that we set mapping error if writeout() fails
Message-ID<tiMN3-GJ-1@gated-at.bofh.it>
If writepage fails during a page migration, then we need to ensure that
fsync will see it by flagging the mapping.

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

diff --git a/mm/migrate.c b/mm/migrate.c
index 9a0897a14d37..a9c0b46865b7 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -789,7 +789,11 @@ static int writeout(struct address_space *mapping, struct page *page)
 		/* unlocked. Relock */
 		lock_page(page);
 
-	return (rc < 0) ? -EIO : -EAGAIN;
+	if (rc < 0) {
+		mapping_set_error(mapping, rc);
+		return -EIO;
+	}
+	return -EAGAIN;
 }
 
 /*
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web