From: Chao Yu Date: Tue, 11 Oct 2016 14:57:06 +0000 (+0800) Subject: f2fs: fix error handling in fsync_node_pages X-Git-Tag: v4.14-rc1~1902^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9de69279750e9740bc7221c7051a40c0516a58fb;p=platform%2Fkernel%2Flinux-rpi.git f2fs: fix error handling in fsync_node_pages In fsync_node_pages, if f2fs was taged with CP_ERROR_FLAG, make sure bio cache was flushed before return. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index e523646..975909c 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1339,7 +1339,8 @@ retry: if (unlikely(f2fs_cp_error(sbi))) { f2fs_put_page(last_page, 0); pagevec_release(&pvec); - return -EIO; + ret = -EIO; + goto out; } if (!IS_DNODE(page) || !is_cold_node(page)) @@ -1412,7 +1413,7 @@ continue_unlock: unlock_page(last_page); goto retry; } - +out: if (nwritten) f2fs_submit_merged_bio_cond(sbi, NULL, NULL, ino, NODE, WRITE); return ret ? -EIO: 0;