diff options
| author | Yunlei He <heyunlei@huawei.com> | 2018-04-24 11:40:30 +0800 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-07-08 17:29:02 -0700 |
| commit | bb015824532c007d9bfbfea91f731d4e02c36320 (patch) | |
| tree | 6ea256f3f68913b85fc5e49ce48adbb3480d1593 | |
| parent | 8bb9a8da75d1678f5c4fc9ec5ea8702960102221 (diff) | |
f2fs: move mnt_want_write_file after range check
This patch move mnt_want_write_file after range check,
it's needless to check arguments with it.
Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| -rw-r--r-- | fs/f2fs/file.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index e1808ed8fc3e..86aa14819637 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2060,15 +2060,15 @@ static int f2fs_ioc_gc_range(struct file *filp, unsigned long arg) if (f2fs_readonly(sbi->sb)) return -EROFS; + end = range.start + range.len; + if (range.start < MAIN_BLKADDR(sbi) || end >= MAX_BLKADDR(sbi)) { + return -EINVAL; + } + ret = mnt_want_write_file(filp); if (ret) return ret; - end = range.start + range.len; - if (range.start < MAIN_BLKADDR(sbi) || end >= MAX_BLKADDR(sbi)) { - ret = -EINVAL; - goto out; - } do_more: if (!range.sync) { if (!mutex_trylock(&sbi->gc_mutex)) { |
