f2fs: check PageWriteback flag for ordered case
PATCH v2 2/3 f2fs: check PageWriteback flag for ordered case
For all ordered cases in f2fs_wait_on_page_writeback(), we need to check PageWriteback status, so let's clean up to relocate the check into f2fs_wait_on_page_writeback().
Signed-off-by Chao Yu <[email protected]>
---
- cover f2fs_sync_meta_pages and f2fs_write_cache_pages as well.
fs/f2fs/checkpoint.c | 2 -- fs/f2fs/data.c | 1 - fs/f2fs/node.c | 3 --- fs/f2fs/segment.c | 6 ++++-- 4 files changed, 4 insertions(+), 8 deletions(-)
fs/f2fs/checkpoint.c +0 -2
@@ -372,7 +372,6 @@ long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,f2fs_wait_on_page_writeback (page,META , true); -BUG_ON (PageWriteback (page));if (!clear_page_dirty_for_io (page)) goto continue_unlock;
@@ -1291,7 +1290,6 @@ static void commit_checkpoint(struct f2fs_sb_info *sbi,int err;f2fs_wait_on_page_writeback (page,META , true); -f2fs_bug_on (sbi,PageWriteback (page));memcpy (page_address (page), src,PAGE_SIZE );
fs/f2fs/data.c +0 -1
@@ -2154,7 +2154,6 @@ static int f2fs_write_cache_pages(struct address_space *mapping, goto continue_unlock; } -BUG_ON (PageWriteback (page));if (!clear_page_dirty_for_io (page)) goto continue_unlock;
fs/f2fs/node.c +0 -3
@@ -1599,7 +1599,6 @@ int f2fs_move_node_page(struct page *node_page, int gc_type) };f2fs_wait_on_page_writeback (node_page,NODE , true); -f2fs_bug_on (F2FS_P_SB (node_page),PageWriteback (node_page));set_page_dirty (node_page);
@@ -1691,7 +1690,6 @@ int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode, }f2fs_wait_on_page_writeback (page,NODE , true); -BUG_ON (PageWriteback (page));set_fsync_mark (page,0 );set_dentry_mark (page,0 );
@@ -1825,7 +1823,6 @@ int f2fs_sync_node_pages(struct f2fs_sb_info *sbi,f2fs_wait_on_page_writeback (page,NODE , true); -BUG_ON (PageWriteback (page));if (!clear_page_dirty_for_io (page)) goto continue_unlock;
fs/f2fs/segment.c +4 -2
@@ -3281,10 +3281,12 @@ void f2fs_wait_on_page_writeback(struct page *page,struct f2fs_sb_info *sbi =F2FS_P_SB (page);f2fs_submit_merged_write_cond (sbi,NULL , page,0 , type); -if (ordered) +if (ordered) {wait_on_page_writeback (page); -else +f2fs_bug_on (sbi,PageWriteback (page)); + }else {wait_for_stable_page (page); + } } }
Signature · 1 line
2.18.0.rc1