[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170412120614.6111-13-jlayton@redhat.com>
Date: Wed, 12 Apr 2017 08:06:09 -0400
From: Jeff Layton <jlayton@...hat.com>
To: linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
tytso@....edu, jack@...e.cz, willy@...radead.org, neilb@...e.com,
viro@...iv.linux.org.uk
Subject: [PATCH v2 12/17] mm: ensure that we set mapping error if writeout() fails
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@...hat.com>
---
mm/migrate.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index ed97c2c14fa8..a77b9e769d0b 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -792,7 +792,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
Powered by blists - more mailing lists