diff options
| author | oster <oster@NetBSD.org> | 2000-02-24 04:39:41 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2000-02-24 04:39:41 +0000 |
| commit | e644abfe94438847b1311d2bf7d8b005924b876f (patch) | |
| tree | 7a95e674b2e871ab6cb4f091f89889c0b5992e11 /sys/dev/raidframe | |
| parent | c5961cfba3f9c86ef5c9540305904fbc286ad561 (diff) | |
Make sure we close auto-configured components appropriately when
attempting a rebuild-in-place.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_reconstruct.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c index a13855f160d..8b1e7c4ebbc 100644 --- a/sys/dev/raidframe/rf_reconstruct.c +++ b/sys/dev/raidframe/rf_reconstruct.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconstruct.c,v 1.17 2000/02/23 03:44:03 oster Exp $ */ +/* $NetBSD: rf_reconstruct.c,v 1.18 2000/02/24 04:39:41 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -477,9 +477,16 @@ rf_ReconstructInPlace(raidPtr, row, col) if (raidPtr->raid_cinfo[row][col].ci_vp != NULL) { printf("Closed the open device: %s\n", raidPtr->Disks[row][col].devname); - VOP_UNLOCK(raidPtr->raid_cinfo[row][col].ci_vp, 0); - (void) vn_close(raidPtr->raid_cinfo[row][col].ci_vp, + if (raidPtr->Disks[row][col].auto_configured == 1) { + VOP_CLOSE(raidPtr->raid_cinfo[row][col].ci_vp, + FREAD, NOCRED, 0); + vput(raidPtr->raid_cinfo[row][col].ci_vp); + + } else { + VOP_UNLOCK(raidPtr->raid_cinfo[row][col].ci_vp, 0); + (void) vn_close(raidPtr->raid_cinfo[row][col].ci_vp, FREAD | FWRITE, proc->p_ucred, proc); + } raidPtr->raid_cinfo[row][col].ci_vp = NULL; } printf("About to (re-)open the device for rebuilding: %s\n", |
