summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-12-23 17:50:30 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-12-30 10:14:09 -0800
commitc34f42e2cb2d27650549306de5ff36839e9177d6 (patch)
tree1672f5a7ac38c08f558d26c27c835c5ccabf6943 /fs/f2fs/file.c
parent2a3407607028f7c780f1c20faa4e922bf631d340 (diff)
f2fs: report error of do_checkpoint
do_checkpoint and write_checkpoint can fail due to reasons like triggering in a readonly fs or encountering IO error of storage device. So it's better to report such error info to user, let user be aware of failure of doing checkpoint. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 888ce4765779..780db8bd2451 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1618,6 +1618,7 @@ static int f2fs_ioc_write_checkpoint(struct file *filp, unsigned long arg)
struct inode *inode = file_inode(filp);
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
struct cp_control cpc;
+ int err;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
@@ -1628,10 +1629,10 @@ static int f2fs_ioc_write_checkpoint(struct file *filp, unsigned long arg)
cpc.reason = __get_cp_reason(sbi);
mutex_lock(&sbi->gc_mutex);
- write_checkpoint(sbi, &cpc);
+ err = write_checkpoint(sbi, &cpc);
mutex_unlock(&sbi->gc_mutex);
- return 0;
+ return err;
}
static int f2fs_defragment_range(struct f2fs_sb_info *sbi,