From: Chao Yu Date: Tue, 29 Nov 2016 03:13:43 +0000 (-0800) Subject: f2fs: return AOP_WRITEPAGE_ACTIVATE for writepage X-Git-Tag: v4.10-rc1~131^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0002b61bdaac732bcff364a18f5bd57c95def0a5;p=karo-tx-linux.git f2fs: return AOP_WRITEPAGE_ACTIVATE for writepage We should use AOP_WRITEPAGE_ACTIVATE when we bypass writing pages. Signed-off-by: Chao Yu Signed-off-by: Miao Xie Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8c5b63bda68b..b90fb010a991 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1384,6 +1384,8 @@ out: redirty_out: redirty_page_for_writepage(wbc, page); + if (!err) + return AOP_WRITEPAGE_ACTIVATE; unlock_page(page); return err; } @@ -1479,6 +1481,15 @@ continue_unlock: 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;