Skip to content

Commit 0135c48

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: fix error path handling in truncate_dnode()
If truncate_node() fails in truncate_dnode(), it missed to call f2fs_put_page(), fix it. Fixes: 7735730 ("f2fs: fix to propagate error from __get_meta_page()") Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 5eda1ad commit 0135c48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/f2fs/node.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,10 @@ static int truncate_dnode(struct dnode_of_data *dn)
943943
dn->ofs_in_node = 0;
944944
f2fs_truncate_data_blocks(dn);
945945
err = truncate_node(dn);
946-
if (err)
946+
if (err) {
947+
f2fs_put_page(page, 1);
947948
return err;
949+
}
948950

949951
return 1;
950952
}

0 commit comments

Comments
 (0)