From davidc@colnta.acns.ab.ca  Fri Jul 20 04:08:32 2001
Return-Path: <davidc@colnta.acns.ab.ca>
Received: from colnta.acns.ab.ca (h24-68-206-125.sbm.shawcable.net [24.68.206.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0BC5D37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 20 Jul 2001 04:08:32 -0700 (PDT)
	(envelope-from davidc@colnta.acns.ab.ca)
Received: (from davidc@localhost)
	by colnta.acns.ab.ca (8.11.4/8.11.3) id f6KB8Vn78122;
	Fri, 20 Jul 2001 05:08:31 -0600 (MDT)
	(envelope-from davidc)
Message-Id: <200107201108.f6KB8Vn78122@colnta.acns.ab.ca>
Date: Fri, 20 Jul 2001 05:08:31 -0600 (MDT)
From: Chad David <davidc@acns.ab.ca>
Reply-To: Chad David <davidc@acns.ab.ca>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] md, disklabel and devfs do not play nice
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         29104
>Category:       kern
>Synopsis:       [PATCH] md, disklabel and devfs do not play nice
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    phk
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 20 04:10:05 PDT 2001
>Closed-Date:    Fri Nov 16 14:55:13 PST 2001
>Last-Modified:  Fri Nov 16 14:55:27 PST 2001
>Originator:     Chad David
>Release:        FreeBSD 5.0-CURRENT
>Organization:
ACNS Inc.
>Environment:
System:FreeBSD whisper.acns.ab.ca 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Fri Jul 20 04:44:58 GMT 2001     davidc@whisper.acns.ab.ca:/usr/src2/src/sys/i386/compile/GENERIC  i386 

>Description:
	When disklabel is run on a md without the full path name to the device a
	new device is created, even if the device name is silly.  If the device
	is the 'c' device then the error message:

	WARNING: Driver mistake: repeat make_dev("md10c")

	is reported.  If the md is detached the system crashes with the following
	error printed over and over:

	WARNING: Driver mistake: destroy_dev on 95/82

	Part of the problem is caused by disklabel auto appending a 'c' onto the
	device name so md10c becomes md10cc, and then disk_clone() doesn't bother
	to check for that.

>How-To-Repeat:

	1) Create a md.
		mdconfig -a -t swap -s 32m -u 10

	2) run disklabel.
		disklabel md10c
		(note console output)

	3) detach the md. (XXX crashes my local machine).
		mdconfig -d -u 10

>Fix:

	Fix disk_clone() so that it does not try and [re]create devices that have bad names.

*** subr_disk.c Fri Jul 20 07:12:39 2001
--- /sys/kern/subr_disk.c       Fri Jun 15 18:43:58 2001
***************
*** 84,92 ****
                                p = name[i] - 'a';
                }
  
-               if (name[i+1] != '\0')
-                   continue;
- 
                *dev = make_dev(pdev->si_devsw, dkmakeminor(u, s, p), 
                    UID_ROOT, GID_OPERATOR, 0640, name);
                dev_depends(pdev, *dev);
--- 84,89 ----

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->phk 
Responsible-Changed-By: dd 
Responsible-Changed-When: Fri Jul 20 04:16:35 PDT 2001 
Responsible-Changed-Why:  
Over to author/maintainer/person with general know-how in this area. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29104 
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Fri Nov 16 14:55:13 PST 2001 
State-Changed-Why:  
This has been fixed in the meantime. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29104 
>Unformatted:
