f2fs: fix to align to section for fallocate() on pinned file
authorChao Yu <yuchao0@huawei.com>
Fri, 5 Mar 2021 09:56:01 +0000 (17:56 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 23 Mar 2021 17:41:12 +0000 (10:41 -0700)
commite1175f02291141bbd924fc578299305fcde35855
tree3be7f1f522ef272344c1583752f6247497912fec
parent0823427989c11240ad0f23561e66ff31a927018f
f2fs: fix to align to section for fallocate() on pinned file

Now, fallocate() on a pinned file only allocates blocks which aligns
to segment rather than section, so GC may try to migrate pinned file's
block, and after several times of failure, pinned file's block could
be migrated to other place, however user won't be aware of such
condition, and then old obsolete block address may be readed/written
incorrectly.

To avoid such condition, let's try to allocate pinned file's blocks
with section alignment.

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/segment.c