summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-04-08 20:39:03 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-05-31 11:31:45 -0700
commit3d165dc3aeef0c9cca7dd760a09f7d08aab0eef2 (patch)
treea631887358ea3b1899ddc02cfcf8a3684c464912
parent764811581d1cfb5f8b1c33b90ed4bcdb363e930a (diff)
downloadlinux-stable-3d165dc3aeef0c9cca7dd760a09f7d08aab0eef2.tar.gz
linux-stable-3d165dc3aeef0c9cca7dd760a09f7d08aab0eef2.tar.bz2
linux-stable-3d165dc3aeef0c9cca7dd760a09f7d08aab0eef2.zip
f2fs: correct return value of f2fs_trim_fs
Correct return value in two cases: - return EINVAL if end boundary is out-of-range. - return EIO if fs needs off-line check. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/segment.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 0fb006f591a4..08b8f2d4faef 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2409,12 +2409,12 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range)
return -EINVAL;
if (end <= MAIN_BLKADDR(sbi))
- goto out;
+ return -EINVAL;
if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) {
f2fs_msg(sbi->sb, KERN_WARNING,
"Found FS corruption, run fsck to fix.");
- goto out;
+ return -EIO;
}
/* start/end segment number in main_area */