f2fs: fix to check return value of f2fs_do_truncate_blocks()
authorChao Yu <chao@kernel.org>
Wed, 5 Apr 2023 14:44:53 +0000 (22:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:23 +0000 (23:03 +0900)
commit2eb5d0165b3691702ede7baaff2c21cfc7bb01f9
tree0b6300107c2212641e864c09405384009571f941
parenta8091dc8149e1f55ad65f4ff31b343d7a56b1e49
f2fs: fix to check return value of f2fs_do_truncate_blocks()

[ Upstream commit b851ee6ba3cc212641e622ebcf92b950c7bafa07 ]

Otherwise, if truncation on cow_inode failed, remained data may
pollute current transaction of atomic write.

Cc: Daeho Jeong <daehojeong@google.com>
Fixes: a46bebd502fe ("f2fs: synchronize atomic write aborts")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/file.c