Skip to contentSkip to conversation

f2fs: return AOP_WRITEPAGE_ACTIVATE for writepage

PATCH New Jaegeuk Kim 1 participant 1 message Dec 1, 2016

Subsystems (2)
lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: return AOP_WRITEPAGE_ACTIVATE for writepage

From: Chao Yu <[email protected]>

We should use AOP_WRITEPAGE_ACTIVATE when we bypass writing pages.

---
 fs/f2fs/data.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
fs/f2fs/data.c +11 -0
index 8c5b63bda68b..b90fb010a991 100644
@@ -1384,6 +1384,8 @@ static int f2fs_write_data_page(struct page *page,
 
 redirty_out:
 	redirty_page_for_writepage(wbc, page);
+	if (!err)
+		return AOP_WRITEPAGE_ACTIVATE;
 	unlock_page(page);
 	return err;
 }
@@ -1479,6 +1481,15 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
 
 			ret = mapping->a_ops->writepage(page, wbc);
 			if (unlikely(ret)) {
+				/*
+				 * keep nr_to_write, since vfs uses this to
+				 * get # of written pages.
+				 */
+				if (ret == AOP_WRITEPAGE_ACTIVATE) {
+					unlock_page(page);
+					ret = 0;
+					continue;
+				}
 				done_index = page->index + 1;
 				done = 1;
 				break;
Signature · 1 line
2.11.0