aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorGreg Lehey <grog@FreeBSD.org>1999-06-22 05:37:57 +0000
committerGreg Lehey <grog@FreeBSD.org>1999-06-22 05:37:57 +0000
commitc9b094473134a9da739507b2baf5459b3f99bdbf (patch)
treedbd96f5bc0469a8b5620db21ebc1dac9dbb1a6ee /sys/dev
parent05f0cb5d5f3c34c6f25374b9a8697503b27147ff (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/vinum/vinumioctl.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/vinum/vinumioctl.c b/sys/dev/vinum/vinumioctl.c
index 74e64886afc2..ce19ce144bb4 100644
--- a/sys/dev/vinum/vinumioctl.c
+++ b/sys/dev/vinum/vinumioctl.c
@@ -516,6 +516,19 @@ attachobject(struct vinum_ioctl_msg *msg)
return;
plex = validplex(msg->otherobject, reply);
if (plex) {
+ /*
+ * We should be more intelligent about this.
+ * We should be able to reattach a dead
+ * subdisk, but if we want to increase the total
+ * number of subdisks, we have a lot of reshuffling
+ * to do. XXX
+ */
+ if ((plex->organization != plex_concat) /* can't attach to striped and raid-5 */
+ &&(!msg->force)) { /* without using force */
+ reply->error = EINVAL; /* no message, the user should check */
+ strcpy(reply->msg, "Can't attach to this plex organization");
+ return;
+ }
if (sd->plexno >= 0) { /* already belong to a plex */
reply->error = EBUSY; /* no message, the user should check */
reply->msg[0] = '\0';
@@ -538,11 +551,6 @@ attachobject(struct vinum_ioctl_msg *msg)
plex = validplex(msg->index, reply); /* get plex */
if (plex == NULL)
return;
- if (plex->organization != plex_concat) { /* can't attach to striped and raid-5 */
- reply->error = EINVAL; /* no message, the user should check */
- reply->msg[0] = '\0';
- return;
- }
vol = validvol(msg->otherobject, reply); /* and volume information */
if (vol) {
if ((vol->plexes == MAXPLEX) /* we have too many already */