From holger.kipp@alogis.com  Thu Apr 25 08:03:04 2002
Return-Path: <holger.kipp@alogis.com>
Received: from alogis.com (firewall.solit-ag.de [212.184.102.1])
	by hub.freebsd.org (Postfix) with ESMTP id 3731E37B428
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 25 Apr 2002 08:03:02 -0700 (PDT)
Received: from alogis.com (kipp@clausthal.int1.b.intern [10.1.1.30])
	by alogis.com (8.11.1/8.9.3) with ESMTP id g3PF30l06837
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 25 Apr 2002 17:03:00 +0200 (CEST)
	(envelope-from holger.kipp@alogis.com)
Message-Id: <3CC81730.5260F586@alogis.com>
Date: Thu, 25 Apr 2002 16:48:16 +0200
From: Holger Kipp <holger.kipp@alogis.com>
Sender: kipp@alogis.com
Reply-To: holger.kipp@alogis.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: twed (3ware escalade) devices not supported by vinum

>Number:         37458
>Category:       bin
>Synopsis:       twed (3ware escalade) devices not supported by vinum
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    grog
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 25 08:10:04 PDT 2002
>Closed-Date:    Thu Apr 25 21:43:07 PDT 2002
>Last-Modified:  Mon Apr 29 02:50:41 PDT 2002
>Originator:     Holger Kipp
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD firewall.solit-ag.de 4.5-STABLE FreeBSD 4.5-STABLE #9: Thu Apr 25 15:39:00 CEST 2002 root@verleihnix.int1.b.intern:/usr/obj/usr/src/sys/VERLEIHNIX i386


>Description:
        twed is not supported by vinum. The first thing is that on stable
        we need to define every device with its major number in vinumio.c.
        The other is that commands.c checks for "vinum start" during boot
        if the device is of type DEVSTAT_TYPE_DIRECT, but does not allow
        DEVSTAT_TYPE_STORARRAY. 
        As vinum could be used to mirror two Raid 5 arrays, or just for 
        an easier disk management, DEVSTAT_TYPE_STORARRAY should also
        be allowed here. 
>How-To-Repeat:
        Try to install vinum on a twed-device, eg /dev/twed1a.  
>Fix:

Apply the following changes:

--- commands.c.orig     Thu Apr 25 15:16:39 2002
+++ commands.c          Thu Apr 25 15:15:48 2002
@@ -542,7 +542,8 @@
        for (i = 0; i < devs; i++) {
            struct devstat *stat = &statinfo.dinfo->devices[i];
 
-           if (((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_DIRECT) /* disk device */
+           if ((((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_DIRECT) /* disk device */
+           || ((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_STORARRAY)) /* storage array */
            &&((stat->device_type & DEVSTAT_TYPE_PASS) == 0) /* and not passthrough */
            &&((stat->device_name[0] != '\0'))) {           /* and it has a name */
                sprintf(enamelist, "%s%s%d", _PATH_DEV, stat->device_name, stat->unit_number);

and

*** vinumio.c.orig      Tue Apr 23 13:05:19 2002
--- vinumio.c           Tue Apr 23 13:22:57 2002
***************
*** 93,98 ****
--- 93,101 ----
      } else if (bcmp(dname, "idad", 4) == 0) {
        devmajor = 109;
        dname += 2;
+     } else if (bcmp(dname, "twed", 4) == 0) {               /* 3ware raid */
+         devmajor = 147;
+         dname += 2;
      } else
        return ENODEV;
      dname += 2;                                                   /* point past */
>Release-Note:
>Audit-Trail:

From: Poul-Henning Kamp <phk@critter.freebsd.dk>
To: holger.kipp@alogis.com
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/37458: twed (3ware escalade) devices not supported by vinum 
Date: Thu, 25 Apr 2002 20:21:55 +0200

 While this patch is technically correct, the code it patches is
 mightily bogus.
 
 >*** vinumio.c.orig      Tue Apr 23 13:05:19 2002
 >--- vinumio.c           Tue Apr 23 13:22:57 2002
 >***************
 >*** 93,98 ****
 >--- 93,101 ----
 >      } else if (bcmp(dname, "idad", 4) == 0) {
 >        devmajor = 109;
 >        dname += 2;
 >+     } else if (bcmp(dname, "twed", 4) == 0) {               /* 3ware raid */
 >+         devmajor = 147;
 >+         dname += 2;
 >      } else
 >        return ENODEV;
 >      dname += 2;                                                   /* point past */
 >>Release-Note:
 >>Audit-Trail:
 >>Unformatted:
 >
 >To Unsubscribe: send mail to majordomo@FreeBSD.org
 >with "unsubscribe freebsd-bugs" in the body of the message
 >
 
 -- 
 Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
 phk@FreeBSD.ORG         | TCP/IP since RFC 956
 FreeBSD committer       | BSD since 4.3-tahoe    
 Never attribute to malice what can adequately be explained by incompetence.
Responsible-Changed-From-To: freebsd-bugs->grog 
Responsible-Changed-By: grog 
Responsible-Changed-When: Thu Apr 25 20:42:33 PDT 2002 
Responsible-Changed-Why:  
grog will close this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37458 
State-Changed-From-To: open->closed 
State-Changed-By: grog 
State-Changed-When: Thu Apr 25 21:42:27 PDT 2002 
State-Changed-Why:  
Patch committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37458 

From: Holger Kipp <holger.kipp@alogis.com>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: bin/37458: twed (3ware escalade) devices not supported by vinum
Date: Thu, 25 Apr 2002 16:48:16 +0200

 >Number:         37458
 >Category:       bin
 >Synopsis:       twed (3ware escalade) devices not supported by vinum
 >Confidential:   no
 >Severity:       non-critical
 >Priority:       medium
 >Responsible:    freebsd-bugs
 >State:          open
 >Quarter:        
 >Keywords:       
 >Date-Required:
 >Class:          sw-bug
 >Submitter-Id:   current-users
 >Arrival-Date:   Thu Apr 25 08:10:04 PDT 2002
 >Closed-Date:
 >Last-Modified:
 >Originator:     Holger Kipp
 >Release:        FreeBSD 4.5-STABLE i386
 >Organization:
 >Environment:
 System: FreeBSD firewall.solit-ag.de 4.5-STABLE FreeBSD 4.5-STABLE #9: Thu Apr 25 15:39:00 CEST 2002 root@verleihnix.int1.b.intern:/usr/obj/usr/src/sys/VERLEIHNIX i386
 
 
 >Description:
         twed is not supported by vinum. The first thing is that on stable
         we need to define every device with its major number in vinumio.c.
         The other is that commands.c checks for "vinum start" during boot
         if the device is of type DEVSTAT_TYPE_DIRECT, but does not allow
         DEVSTAT_TYPE_STORARRAY. 
         As vinum could be used to mirror two Raid 5 arrays, or just for 
         an easier disk management, DEVSTAT_TYPE_STORARRAY should also
         be allowed here. 
 >How-To-Repeat:
         Try to install vinum on a twed-device, eg /dev/twed1a.  
 >Fix:
 
 Apply the following changes:
 
 --- commands.c.orig     Thu Apr 25 15:16:39 2002
 +++ commands.c          Thu Apr 25 15:15:48 2002
 @@ -542,7 +542,8 @@
         for (i = 0; i < devs; i++) {
             struct devstat *stat = &statinfo.dinfo->devices[i];
  
 -           if (((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_DIRECT) /* disk device */
 +           if ((((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_DIRECT) /* disk device */
 +           || ((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_STORARRAY)) /* storage array */
             &&((stat->device_type & DEVSTAT_TYPE_PASS) == 0) /* and not passthrough */
             &&((stat->device_name[0] != '\0'))) {           /* and it has a name */
                 sprintf(enamelist, "%s%s%d", _PATH_DEV, stat->device_name, stat->unit_number);
 
 and
 
 *** vinumio.c.orig      Tue Apr 23 13:05:19 2002
 --- vinumio.c           Tue Apr 23 13:22:57 2002
 ***************
 *** 93,98 ****
 --- 93,101 ----
       } else if (bcmp(dname, "idad", 4) == 0) {
         devmajor = 109;
         dname += 2;
 +     } else if (bcmp(dname, "twed", 4) == 0) {               /* 3ware raid */
 +         devmajor = 147;
 +         dname += 2;
       } else
         return ENODEV;
       dname += 2;                                                   /* point past */
 >Release-Note:
 >Audit-Trail:
 >Unformatted:
 
 To Unsubscribe: send mail to majordomo@FreeBSD.org
 with "unsubscribe freebsd-bugs" in the body of the message
 
>Unformatted:

Greg Lehey, 26 April 2002

	Patch committed, thanks.
