From root@mail.paradise-green.co.uk  Fri Nov  7 07:41:51 2003
Return-Path: <root@mail.paradise-green.co.uk>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 930E416A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  7 Nov 2003 07:41:51 -0800 (PST)
Received: from mail.paradise-green.co.uk (161-86-19-212-hpnt-t3-z2.wireless.as15758.net [212.19.86.161])
	by mx1.FreeBSD.org (Postfix) with ESMTP id BC06343FEA
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  7 Nov 2003 07:41:49 -0800 (PST)
	(envelope-from root@mail.paradise-green.co.uk)
Received: from mail.paradise-green.co.uk (localhost.paradise [127.0.0.1])
	by mail.paradise-green.co.uk (8.12.9p2/8.12.9) with ESMTP id hA7FflgI000781
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 7 Nov 2003 15:41:47 GMT
	(envelope-from root@mail.paradise-green.co.uk)
Received: (from root@localhost)
	by mail.paradise-green.co.uk (8.12.9p2/8.12.9/Submit) id hA7FfkS2000780;
	Fri, 7 Nov 2003 15:41:46 GMT
	(envelope-from root)
Message-Id: <200311071541.hA7FfkS2000780@mail.paradise-green.co.uk>
Date: Fri, 7 Nov 2003 15:41:46 GMT
From: freebsduser@paradisegreen.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Vinum fails to initialise on hardware drive arrays.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         59042
>Category:       bin
>Synopsis:       Vinum fails to initialise on hardware drive arrays.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    le
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 07 07:50:17 PST 2003
>Closed-Date:    Wed Apr 07 23:40:25 PDT 2004
>Last-Modified:  Wed Apr 07 23:40:25 PDT 2004
>Originator:     Thomas Sandford
>Release:        FreeBSD 4.9-RELEASE i386
>Organization:
Paradise Green Technical Services
>Environment:
System: FreeBSD almaz.paradise 4.9-RELEASE FreeBSD 4.9-RELEASE #0: Fri Nov 7 02:00:20 GMT 2003 root@almaz.paradise:/usr/src/sys/compile/ALMAZ i386


	The machine has a Compaq Smart Arry 3200 controller fitted
        (idad driver) and vinum is used to subdivide the partitions
	on the resulting virtual drives.

>Description:
	vinum start gives a syntax error and fails to load the previous
	configuration.

	This is a bug introduced in /usr/src/sbin/vinum/commands.c
	at version 1.31.2.6

	The test introduced to detect md drives triggers on almost
	anything that is not a conventional ATAPI/SCSI drive.

	A better test is suggested in Fix: below.

>How-To-Repeat:
	Attempt to use vinum on most hardware drive array controllers.

>Fix:

apply the following patch to /usr/src/sbin/vinum/commands.c
(patch against 1.31.2.6)

--- commands.c.orig	Fri Nov  7 14:54:34 2003
+++ commands.c	Fri Nov  7 15:09:01 2003
@@ -546,9 +546,9 @@
 	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 */
-		 || ((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_STORARRAY)) /* storage array */
-	    &&((stat->device_type & DEVSTAT_TYPE_IF_MASK) != DEVSTAT_TYPE_IF_OTHER) /* and not md */
+	    if (((((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_DIRECT) /* disk device */
+	        &&((stat->device_type & DEVSTAT_TYPE_IF_MASK) != DEVSTAT_TYPE_IF_OTHER)) /* and not md */
+ 		||((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);

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->grog 
Responsible-Changed-By: kris 
Responsible-Changed-When: Fri Nov 7 14:21:37 PST 2003 
Responsible-Changed-Why:  
Assign to vinum author 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59042 
Responsible-Changed-From-To: grog->le 
Responsible-Changed-By: le 
Responsible-Changed-When: Tue Apr 6 04:19:00 PDT 2004 
Responsible-Changed-Why:  
Steal PR from grog@. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59042 
State-Changed-From-To: open->closed 
State-Changed-By: le 
State-Changed-When: Wed Apr 7 23:40:04 PDT 2004 
State-Changed-Why:  
Patch committed, thank you. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59042 
>Unformatted:
