diff options
author | Chao Yu | 2023-06-29 09:41:02 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-07-19 16:22:03 +0200 |
commit | c2c5c6d2c474eb771b35322d8eeac0905efd14ff (patch) | |
tree | e0658895ce3bc67da6531bf72382c20de4688856 | |
parent | cfdb9c1a74d8394fab6ef4b27a5f4d4af8338a83 (diff) |
f2fs: fix error path handling in truncate_dnode()
[ Upstream commit 0135c482fa97e2fd8245cb462784112a00ed1211 ]
If truncate_node() fails in truncate_dnode(), it missed to call
f2fs_put_page(), fix it.
Fixes: 7735730d39d7 ("f2fs: fix to propagate error from __get_meta_page()")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | fs/f2fs/node.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 07419c3e42a5..a010b4bc36d2 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -941,8 +941,10 @@ static int truncate_dnode(struct dnode_of_data *dn) dn->ofs_in_node = 0; f2fs_truncate_data_blocks(dn); err = truncate_node(dn); - if (err) + if (err) { + f2fs_put_page(page, 1); return err; + } return 1; } |