f2fs: fix to allow migrating fully valid segment
authorChao Yu <yuchao0@huawei.com>
Sat, 20 Feb 2021 09:35:40 +0000 (17:35 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 12 Mar 2021 21:16:41 +0000 (13:16 -0800)
commit7dede88659df38f96128ab3922c50dde2d29c574
tree6f1b51ca470ec210cc799f14ff31681fdd202cf1
parentc67c8c0f47eb0bf49d6cf165389554e379443968
f2fs: fix to allow migrating fully valid segment

F2FS_IOC_FLUSH_DEVICE/F2FS_IOC_RESIZE_FS needs to migrate all blocks of
target segment to other place, no matter the segment has partially or fully
valid blocks.

However, after commit 803e74be04b3 ("f2fs: stop GC when the victim becomes
fully valid"), we may skip migration due to target segment is fully valid,
result in failing the ioctl interface, fix this.

Fixes: 803e74be04b3 ("f2fs: stop GC when the victim becomes fully valid")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/gc.c
fs/f2fs/segment.c
fs/f2fs/super.c