Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20d4b4a4 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

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: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent e21b3152
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2490,12 +2490,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 */