提交 2e006393 编写于 作者: E Evgeniy Dushistov 提交者: Linus Torvalds

[PATCH] ufs: unlock_super without lock

ufs_free_blocks function looks now in so way:
if (err)
 goto failed;
 lock_super();
failed:
 unlock_super();

So if error happen we'll unlock not locked super.
Signed-off-by: NEvgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 50aa4eb0
......@@ -156,7 +156,7 @@ void ufs_free_blocks(struct inode *inode, unsigned fragment, unsigned count)
bit = ufs_dtogd (fragment);
if (cgno >= uspi->s_ncg) {
ufs_panic (sb, "ufs_free_blocks", "freeing blocks are outside device");
goto failed;
goto failed_unlock;
}
end_bit = bit + count;
if (end_bit > uspi->s_fpg) {
......@@ -167,11 +167,11 @@ void ufs_free_blocks(struct inode *inode, unsigned fragment, unsigned count)
ucpi = ufs_load_cylinder (sb, cgno);
if (!ucpi)
goto failed;
goto failed_unlock;
ucg = ubh_get_ucg (UCPI_UBH(ucpi));
if (!ufs_cg_chkmagic(sb, ucg)) {
ufs_panic (sb, "ufs_free_blocks", "internal error, bad magic number on cg %u", cgno);
goto failed;
goto failed_unlock;
}
for (i = bit; i < end_bit; i += uspi->s_fpb) {
......@@ -210,8 +210,9 @@ void ufs_free_blocks(struct inode *inode, unsigned fragment, unsigned count)
UFSD("EXIT\n");
return;
failed:
failed_unlock:
unlock_super (sb);
failed:
UFSD("EXIT (FAILED)\n");
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册