From 684873a19264134acbe0a7c2388ad9a1d4870efb Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Mon, 15 Dec 2003 00:42:03 +0000 Subject: [PATCH] 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. --- sys/dev/vinum/vinum.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c index 5544cae5975f..513c0d968c59 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 */