summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2016-08-21 18:21:29 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2016-08-30 04:31:11 +0300
commite932835377f95c91789c8572a5aaaa9daad5d262 (patch)
tree0a2f66a5e465646fdbeafa005ded2b475feee289 /fs/f2fs
parent58383befc3377b4e2305b98f91e445af73ba8d62 (diff)
downloadlinux-e932835377f95c91789c8572a5aaaa9daad5d262.tar.xz
f2fs: check return value of write_checkpoint during fstrim
During fstrim, if one of multiple write_checkpoint failed, break off and return error number to caller. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/segment.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index a3940129e3b2..020767c67935 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1303,6 +1303,8 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range)
mutex_lock(&sbi->gc_mutex);
err = write_checkpoint(sbi, &cpc);
mutex_unlock(&sbi->gc_mutex);
+ if (err)
+ break;
}
out:
range->len = F2FS_BLK_TO_BYTES(cpc.trimmed);