]> 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:29:36 +0000 (16:29 +0200)
commit87f9d26fcc50531315b1b127f35a78f69e1e45d0
treefabfa901746c407fe91c40e940f255f8d32b76e4
parent67c3c4638f22942d900386f11fc10ed6a3520910
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