]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
f2fs: fix to update last i_size if fallocate partially succeeds
authorChao Yu <yuchao0@huawei.com>
Wed, 24 Mar 2021 03:24:33 +0000 (11:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:37 +0000 (10:29 +0200)
commit12ad20fc551ca817383a1125ceb27f430b4dc9cb
tree100a342ac604b9566c3836088df4c819d8e2c82a
parent0a0a6e69764e992069fc0d7570444ece9f048b8d
f2fs: fix to update last i_size if fallocate partially succeeds

[ Upstream commit 88f2cfc5fa90326edb569b4a81bb38ed4dcd3108 ]

In the case of expanding pinned file, map.m_lblk and map.m_len
will update in each round of section allocation, so in error
path, last i_size will be calculated with wrong m_lblk and m_len,
fix it.

Fixes: f5a53edcf01e ("f2fs: support aligned pinned file")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/file.c