2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 09:13:55 +08:00

f2fs: put the inode page when error was occurred

We should put the inode page when error was occurred.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim 2014-11-17 16:14:11 -08:00
parent 6d20aff83c
commit 8cdcb71322

View File

@ -963,22 +963,22 @@ repeat:
} else if (page->index == 0) { } else if (page->index == 0) {
err = f2fs_convert_inline_page(&dn, page); err = f2fs_convert_inline_page(&dn, page);
if (err) if (err)
goto unlock_fail; goto put_fail;
} else { } else {
struct page *p = grab_cache_page(inode->i_mapping, 0); struct page *p = grab_cache_page(inode->i_mapping, 0);
if (!p) { if (!p) {
err = -ENOMEM; err = -ENOMEM;
goto unlock_fail; goto put_fail;
} }
err = f2fs_convert_inline_page(&dn, p); err = f2fs_convert_inline_page(&dn, p);
f2fs_put_page(p, 1); f2fs_put_page(p, 1);
if (err) if (err)
goto unlock_fail; goto put_fail;
} }
} }
err = f2fs_reserve_block(&dn, index); err = f2fs_reserve_block(&dn, index);
if (err) if (err)
goto unlock_fail; goto put_fail;
put_next: put_next:
f2fs_put_dnode(&dn); f2fs_put_dnode(&dn);
f2fs_unlock_op(sbi); f2fs_unlock_op(sbi);
@ -1021,6 +1021,8 @@ out:
clear_cold_data(page); clear_cold_data(page);
return 0; return 0;
put_fail:
f2fs_put_dnode(&dn);
unlock_fail: unlock_fail:
f2fs_unlock_op(sbi); f2fs_unlock_op(sbi);
f2fs_put_page(page, 1); f2fs_put_page(page, 1);