Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/chfs Make sure that mutex is released before conditi...
details: https://anonhg.NetBSD.org/src/rev/200e3f8af6c3
branches: trunk
changeset: 984672:200e3f8af6c3
user: andvar <andvar%NetBSD.org@localhost>
date: Thu Jul 15 22:39:06 2021 +0000
description:
Make sure that mutex is released before conditional return statements. Fixes PR kern/56242
ok riastradh
diffstat:
sys/ufs/chfs/chfs_readinode.c | 3 ++-
sys/ufs/chfs/chfs_scan.c | 8 ++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diffs (54 lines):
diff -r 3b1468cf186d -r 200e3f8af6c3 sys/ufs/chfs/chfs_readinode.c
--- a/sys/ufs/chfs/chfs_readinode.c Thu Jul 15 21:56:51 2021 +0000
+++ b/sys/ufs/chfs/chfs_readinode.c Thu Jul 15 22:39:06 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chfs_readinode.c,v 1.10 2017/06/01 02:45:15 chs Exp $ */
+/* $NetBSD: chfs_readinode.c,v 1.11 2021/07/15 22:39:06 andvar Exp $ */
/*-
* Copyright (c) 2010 Department of Software Engineering,
@@ -1012,6 +1012,7 @@
(unsigned long long)vc->vno, vc->state);
chfs_err("wants to read a nonexistent ino %llu\n",
(unsigned long long)vc->vno);
+ mutex_exit(&chmp->chm_lock_vnocache);
return ENOENT;
default:
panic("BUG() Bad vno cache state.");
diff -r 3b1468cf186d -r 200e3f8af6c3 sys/ufs/chfs/chfs_scan.c
--- a/sys/ufs/chfs/chfs_scan.c Thu Jul 15 21:56:51 2021 +0000
+++ b/sys/ufs/chfs/chfs_scan.c Thu Jul 15 22:39:06 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chfs_scan.c,v 1.8 2019/06/17 17:14:56 ryoon Exp $ */
+/* $NetBSD: chfs_scan.c,v 1.9 2021/07/15 22:39:06 andvar Exp $ */
/*-
* Copyright (c) 2010 Department of Software Engineering,
@@ -151,6 +151,7 @@
} else {
err = chfs_update_eb_dirty(chmp, cheb,
sizeof(struct chfs_flash_vnode));
+ mutex_exit(&chmp->chm_lock_vnocache);
return CHFS_NODE_OK;
}
} else {
@@ -325,6 +326,7 @@
parentvc = chfs_scan_make_vnode_cache(chmp, le64toh(dirent->pvno));
if (!parentvc) {
chfs_free_dirent(fd);
+ mutex_exit(&chmp->chm_lock_vnocache);
return ENOMEM;
}
@@ -381,8 +383,10 @@
vc = chfs_vnode_cache_get(chmp, vno);
if (!vc) {
vc = chfs_scan_make_vnode_cache(chmp, vno);
- if (!vc)
+ if (!vc) {
+ mutex_exit(&chmp->chm_lock_vnocache);
return ENOMEM;
+ }
}
chfs_add_node_to_list(chmp, vc, nref, &vc->dnode);
mutex_exit(&chmp->chm_lock_vnocache);
Home |
Main Index |
Thread Index |
Old Index