]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit7f63fa7eab0b0a5df0dfbc6ab372832bff6ebaff
tree3be7f1f522ef272344c1583752f6247497912fec
parentc2e8846023d0ada767ff9effa047a13fa007b5d9
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