* [PATCH v3] f2fs: move mnt_want_write_file after range check
@ 2018-04-24 10:58 Yunlei He
2018-04-25 13:17 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: Yunlei He @ 2018-04-24 10:58 UTC (permalink / raw)
To: jaegeuk, yuchao0, linux-f2fs-devel; +Cc: zhangdianfang
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>
---
fs/f2fs/file.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 16dad2b..6b79b8a 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2061,15 +2061,14 @@ 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)) {
--
1.9.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] f2fs: move mnt_want_write_file after range check
2018-04-24 10:58 [PATCH v3] f2fs: move mnt_want_write_file after range check Yunlei He
@ 2018-04-25 13:17 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2018-04-25 13:17 UTC (permalink / raw)
To: Yunlei He, jaegeuk, yuchao0, linux-f2fs-devel; +Cc: zhangdianfang
On 2018/4/24 18:58, Yunlei He wrote:
> 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>
Thanks,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-25 13:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24 10:58 [PATCH v3] f2fs: move mnt_want_write_file after range check Yunlei He
2018-04-25 13:17 ` Chao Yu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.