diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-09-18 14:18:19 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-09-18 14:18:19 +0000 |
commit | a2835edc39bac23928a74d9bb762d86fb088dde3 (patch) | |
tree | 2772d16d26301ba871ccfcc768b13d63ecdfe14f /sys/dev | |
parent | f13f7c00610d1a2078ebd963531c0387a9b73ca9 (diff) |
Correctly close RAID components. Fixes PR 4508, okay deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/raidframe/rf_openbsdkintf.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/raidframe/rf_openbsdkintf.c b/sys/dev/raidframe/rf_openbsdkintf.c index e60386cb935..97079e13204 100644 --- a/sys/dev/raidframe/rf_openbsdkintf.c +++ b/sys/dev/raidframe/rf_openbsdkintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rf_openbsdkintf.c,v 1.27 2004/11/28 02:47:14 pedro Exp $ */ +/* $OpenBSD: rf_openbsdkintf.c,v 1.28 2005/09/18 14:18:18 pedro Exp $ */ /* $NetBSD: rf_netbsdkintf.c,v 1.109 2001/07/27 03:30:07 oster Exp $ */ /*- @@ -2596,18 +2596,15 @@ rf_update_component_labels(RF_Raid_t *raidPtr, int final) void rf_close_component(RF_Raid_t *raidPtr, struct vnode *vp, int auto_configured) { - struct proc *p; - - if ((p = raidPtr->engine_thread) == NULL) - p = curproc; + struct proc *p = curproc; if (vp != NULL) { if (auto_configured == 1) { - VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, p); + /* component was opened by rf_find_raid_components() */ + VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, NULL); vrele(vp); } else { - if (VOP_ISLOCKED(vp)) - VOP_UNLOCK(vp, 0, p); + /* component was opened by raidlookup() */ (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, p); } } else { |