summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2016-10-11 22:57:06 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2016-11-23 12:10:56 -0800
commit9de69279750e9740bc7221c7051a40c0516a58fb (patch)
treedd5015781649173d4eb82cee320769080a3d4a33 /fs
parentb691d98fdd4cc2514c60fd6975e6016da203e64f (diff)
downloadlinux-stable-9de69279750e9740bc7221c7051a40c0516a58fb.tar.gz
linux-stable-9de69279750e9740bc7221c7051a40c0516a58fb.tar.bz2
linux-stable-9de69279750e9740bc7221c7051a40c0516a58fb.zip
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 <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/node.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index e5236463781a..975909c146a1 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;