Skip to content

Commit 94d4ac4

Browse files
Jaegeuk KimJaegeuk Kim
Jaegeuk Kim
authored and
Jaegeuk Kim
committed
f2fs: return EINVAL for hole cases in swap file
This tries to fix xfstests/generic/495. Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent a73ac04 commit 94d4ac4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/f2fs/data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3940,7 +3940,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis,
39403940
/* hole */
39413941
if (!(map.m_flags & F2FS_MAP_FLAGS)) {
39423942
f2fs_err(sbi, "Swapfile has holes\n");
3943-
ret = -ENOENT;
3943+
ret = -EINVAL;
39443944
goto out;
39453945
}
39463946

@@ -4096,7 +4096,7 @@ static int check_swap_activate(struct swap_info_struct *sis,
40964096
return ret;
40974097
bad_bmap:
40984098
f2fs_err(sbi, "Swapfile has holes\n");
4099-
return -ENOENT;
4099+
return -EINVAL;
41004100
}
41014101

41024102
static int f2fs_swap_activate(struct swap_info_struct *sis, struct file *file,

0 commit comments

Comments
 (0)