Skip to content

Commit 9c9f348

Browse files
chaseyupundiramit
authored andcommitted
f2fs: return AOP_WRITEPAGE_ACTIVATE for writepage
commit 0002b61bdaac732bcff364a18f5bd57c95def0a5 upstream. We should use AOP_WRITEPAGE_ACTIVATE when we bypass writing pages. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Miao Xie <miaoxie@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent f5cd931 commit 9c9f348

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

fs/f2fs/data.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,8 @@ static int f2fs_write_data_page(struct page *page,
13761376

13771377
redirty_out:
13781378
redirty_page_for_writepage(wbc, page);
1379+
if (!err)
1380+
return AOP_WRITEPAGE_ACTIVATE;
13791381
unlock_page(page);
13801382
return err;
13811383
}
@@ -1471,6 +1473,15 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
14711473

14721474
ret = mapping->a_ops->writepage(page, wbc);
14731475
if (unlikely(ret)) {
1476+
/*
1477+
* keep nr_to_write, since vfs uses this to
1478+
* get # of written pages.
1479+
*/
1480+
if (ret == AOP_WRITEPAGE_ACTIVATE) {
1481+
unlock_page(page);
1482+
ret = 0;
1483+
continue;
1484+
}
14741485
done_index = page->index + 1;
14751486
done = 1;
14761487
break;

0 commit comments

Comments
 (0)