f2fs: fix to allow node segment for GC by ioctl path
authorSahitya Tummala <stummala@codeaurora.org>
Mon, 26 Nov 2018 08:01:41 +0000 (13:31 +0530)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 27 Nov 2018 00:38:46 +0000 (16:38 -0800)
Allow node type segments also to be GC'd via f2fs ioctl
F2FS_IOC_GARBAGE_COLLECT_RANGE.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/gc.c

index 8606ebf..9a60801 100644 (file)
@@ -323,8 +323,7 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi,
        p.min_cost = get_max_cost(sbi, &p);
 
        if (*result != NULL_SEGNO) {
-               if (IS_DATASEG(get_seg_entry(sbi, *result)->type) &&
-                       get_valid_blocks(sbi, *result, false) &&
+               if (get_valid_blocks(sbi, *result, false) &&
                        !sec_usage_check(sbi, GET_SEC_FROM_SEG(sbi, *result)))
                        p.min_segno = *result;
                goto out;