]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
f2fs: Create COW inode from parent dentry for atomic write
authorYeongjin Gil <youngjin.gil@samsung.com>
Tue, 13 Aug 2024 07:32:44 +0000 (16:32 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:33:14 +0000 (16:33 +0200)
commitaf605d5099dc401a2545a29655c95a0319c876da
treed266496db6ff48bc82cb38f9719ffb03cfff38d5
parentb21c3009a86f057b3402776e49c98ba8a10e431a
f2fs: Create COW inode from parent dentry for atomic write

[ Upstream commit 8c1b787938fd86bab27a1492fa887408c75fec2b ]

The i_pino in f2fs_inode_info has the previous parent's i_ino when inode
was renamed, which may cause f2fs_ioc_start_atomic_write to fail.
If file_wrong_pino is true and i_nlink is 1, then to find a valid pino,
we should refer to the dentry from inode.

To resolve this issue, let's get parent inode using parent dentry
directly.

Fixes: 3db1de0e582c ("f2fs: change the current atomic write way")
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Reviewed-by: Sunmin Jeong <s_min.jeong@samsung.com>
Signed-off-by: Yeongjin Gil <youngjin.gil@samsung.com>
Reviewed-by: Daeho Jeong <daehojeong@google.com>
Reviewed-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