f2fs: release locks before return in f2fs_ioc_gc_range()
Subsystems (2)
PATCH 1/1 f2fs: release locks before return in f2fs_ioc_gc_range()
From: Qiuyang Sun <[email protected]>
Currently, we will leave the kernel with locks still held when the gc_range is invalid. This patch fixes the bug.
Signed-off-by Qiuyang Sun <[email protected]>
--- fs/f2fs/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/f2fs/file.c +4 -2
@@ -2059,8 +2059,10 @@ static int f2fs_ioc_gc_range(struct file *filp, unsigned long arg)return ret; end = range.start + range.len; -if (range.start <MAIN_BLKADDR (sbi) || end >=MAX_BLKADDR (sbi)) -return -EINVAL ; +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)) {
Signature · 1 line
2.5.0
Quoted 6 lines · sunqiuyang
From: Qiuyang Sun <[email protected]>
Currently, we will leave the kernel with locks still held when the
gc_rangeis invalid. This patch fixes the bug.Signed-off-by Qiuyang Sun <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,