summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2003-12-15 00:42:03 +0000
committergrog <grog@FreeBSD.org>2003-12-15 00:42:03 +0000
commitfc3a1fcb367b7fb1660d6fc171237cccfc5b182e (patch)
treebd11a85602e59cdcdf9d4a604afb37a90410d294 /sys/dev/vinum
parent27d0a79cf6dccd9b00901fa7d3ccc693b15d4dfe (diff)
downloadFreeBSD-src-fc3a1fcb367b7fb1660d6fc171237cccfc5b182e.zip
FreeBSD-src-fc3a1fcb367b7fb1660d6fc171237cccfc5b182e.tar.gz
vinumclose: Fix day-one bug. Subdisks and plexes were not being
marked closed. This made it impossible to stop Vinum after explicitly opening a plex or subdisk.
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r--sys/dev/vinum/vinum.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c
index 5544cae..513c0d9 100644
--- a/sys/dev/vinum/vinum.c
+++ b/sys/dev/vinum/vinum.c
@@ -495,13 +495,22 @@ vinumclose(dev_t dev,
case VINUM_PLEX_TYPE:
if (Volno(dev) >= vinum_conf.volumes_allocated)
return ENXIO;
- /* FALLTHROUGH */
+ index = Plexno (dev);
+ if (index >= vinum_conf.plexes_allocated) /* no such plex */
+ return ENXIO;
+ PLEX [index].flags &= ~VF_OPEN; /* no longer open */
+ return 0;
case VINUM_SD_TYPE:
if ((Volno(dev) >= vinum_conf.volumes_allocated) || /* no such volume */
(Plexno(dev) >= vinum_conf.plexes_allocated)) /* or no such plex */
return ENXIO; /* no such device */
- /* FALLTHROUGH */
+ index = Sdno (dev);
+ if (index >= vinum_conf.subdisks_allocated) /* no such sd */
+ return ENXIO;
+ SD [index].flags &= ~VF_OPEN; /* no longer open */
+ return 0;
+
default:
return ENODEV; /* don't know what to do with these */
OpenPOWER on IntegriCloud