summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-04-15 18:25:04 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2016-04-26 23:24:54 +0200
commitc267ec1526da2d3b12c80a89ebd8eb9b6a01d636 (patch)
treee55f335a2b1d0271a650827ef9e4af0d8db2fed4 /fs/f2fs/node.c
parentf2fs: split sync_node_pages with fsync_node_pages (diff)
downloadlinux-c267ec1526da2d3b12c80a89ebd8eb9b6a01d636.tar.xz
linux-c267ec1526da2d3b12c80a89ebd8eb9b6a01d636.zip
f2fs: report unwritten status in fsync_node_pages
The fsync_node_pages should return pass or failure so that user could know fsync is completed or not. Acked-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r--fs/f2fs/node.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 675b7304c02a..8a1e21144ecb 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1227,7 +1227,7 @@ int fsync_node_pages(struct f2fs_sb_info *sbi, nid_t ino,
{
pgoff_t index, end;
struct pagevec pvec;
- int nwritten = 0;
+ int ret = 0;
pagevec_init(&pvec, 0);
index = 0;
@@ -1278,21 +1278,20 @@ continue_unlock:
if (IS_INODE(page))
set_dentry_mark(page,
need_dentry_mark(sbi, ino));
- nwritten++;
- if (NODE_MAPPING(sbi)->a_ops->writepage(page, wbc))
+ ret = NODE_MAPPING(sbi)->a_ops->writepage(page, wbc);
+ if (ret) {
unlock_page(page);
-
- if (--wbc->nr_to_write == 0)
break;
+ }
}
pagevec_release(&pvec);
cond_resched();
- if (wbc->nr_to_write == 0)
+ if (ret)
break;
}
- return nwritten;
+ return ret ? -EIO: 0;
}
int sync_node_pages(struct f2fs_sb_info *sbi, struct writeback_control *wbc)