Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Aug 1997 19:10:50 +0400 (MSD)
From:      Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Cc:        julian@FreeBSD.ORG
Subject:   kern/4396: DEVFS: new devices on the 'backing plane' never propagated to 'front planes'
Message-ID:  <199708261510.TAA00594@tejblum.dnttm.rssi.ru>
Resent-Message-ID: <199708261520.IAA16377@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         4396
>Category:       kern
>Synopsis:       DEVFS: new devices on the 'backing plane' never propagated to 'front planes'
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 26 08:20:01 PDT 1997
>Last-Modified:
>Originator:     Dmitrij Tejblum
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:


>Description:

Function 'devfs_propogate' should do the propagation. It tryes to iterate 
front planes with the following cycl:

	for (adnp = pdnp->nextsibling;
		adnp != pdnp->nextsibling;
 		adnp = adnp->nextsibling)

Obvious, the cycl will never run, because after adnp = pdnp->nextsibling 
condition adnp != pdnp->nextsibling cannot be true.

>How-To-Repeat:

You can rproduce the problem with the vn device:

Create a big zero-filled file.
Mount a DEVFS somewhere.
Set 'labels' option to a vn device: vnconfig -s labels /dev/vn0
Attach the file to the vn device: vnconfig -c /dev/vn0 /usr/fsimage
Disklabel the device: disklabel -Brw vn0 auto
See that vn0c didn't appeared in the DEVFS.

If you already have disklabeled disk image, you may simple do:
vnconfig -s labels /dev/vn0
vnconfig -c /dev/vn0 /usr/fsimage
and see if it's partitions appeared in the DEVFS.

(Unfortunately, even with the following fix, after 
vnconfig -s labels -c /dev/vn0 /usr/fsimage
partitions don't appeared in DEVFS. 
2 separate command, as above, should be used. 
It is a bug in vnconfig/vn device)

>Fix:
	
--- devfs_tree.c.00	Thu Jul 17 15:12:23 1997
+++ devfs_tree.c	Mon Aug 25 23:57:48 1997
@@ -543,7 +543,7 @@
 	* Find the other instances of the parent node	*
 	\***********************************************/
 	for (adnp = pdnp->nextsibling;
-		adnp != pdnp->nextsibling;
+		adnp != pdnp;
 		adnp = adnp->nextsibling)
 	{
 		/*
@@ -551,7 +551,7 @@
 		 * if the node already exists on that plane it won't be
 		 * re-made..
 		 */
-		if ( error = dev_add_entry(child->name, pdnp, type,
+		if ( error = dev_add_entry(child->name, adnp, type,
 					NULL, dnp, adnp->dvm, &newnmp)) {
 			printf("duplicating %s failed\n",child->name);
 		}

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708261510.TAA00594>