]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: change segment to section in f2fs_ioc_gc_range
authorYunlong Song <yunlong.song@huawei.com>
Tue, 30 Oct 2018 12:37:55 +0000 (20:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:51:49 +0000 (08:51 +0100)
[ Upstream commit 67b0e42b768c9ddc3fd5ca1aee3db815cfaa635c ]

f2fs_ioc_gc_range skips blocks_per_seg each time, however, f2fs_gc moves
blocks of section each time, so fix it from segment to section.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/file.c

index 187bf7e260c991c7a98e083f5a9f0a2520baeafd..5eef2a8b29ab62dc3f51273a739f46a8a2880ec5 100644 (file)
@@ -2143,7 +2143,7 @@ do_more:
        }
 
        ret = f2fs_gc(sbi, range.sync, true, GET_SEGNO(sbi, range.start));
-       range.start += sbi->blocks_per_seg;
+       range.start += BLKS_PER_SEC(sbi);
        if (range.start <= end)
                goto do_more;
 out: