From nobody@FreeBSD.org  Fri Jan 20 14:07:22 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 39F8816A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Jan 2006 14:07:22 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E873543D45
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Jan 2006 14:07:21 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k0KE7LIb055378
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Jan 2006 14:07:21 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k0KE7L3v055372;
	Fri, 20 Jan 2006 14:07:21 GMT
	(envelope-from nobody)
Message-Id: <200601201407.k0KE7L3v055372@www.freebsd.org>
Date: Fri, 20 Jan 2006 14:07:21 GMT
From: bernard buri <bsd@ask-us.at>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mdconfig -l shows 95 entries max.
X-Send-Pr-Version: www-2.3

>Number:         92062
>Category:       bin
>Synopsis:       mdconfig(8): mdconfig -l shows 95 entries max.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    phk
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 20 14:10:04 GMT 2006
>Closed-Date:    Wed Jan 06 16:45:36 UTC 2010
>Last-Modified:  Wed Jan 06 16:45:36 UTC 2010
>Originator:     bernard buri
>Release:        5.4-RELEASEp8
>Organization:
ask!
>Environment:
FreeBSD xxx.domain.com 5.4-RELEASE-p8 FreeBSD 5.4-RELEASE-p8 #2: Tue Jan  3 09:47:43 CET 2006     root@berni.matrixware.com:/usr/obj/usr/src/sys/BERNI  i386
>Description:
when adding more than 100 memory disks via mdconfig -a -t vnode -f ..., mdconfig -l only shows the 95 last added entries.
>How-To-Repeat:
perl -e 'for(1..200){`touch $_` && `mdconfig -a -t vnode -f $_`}'
mdconfig -l
ls /dev/md*
>Fix:
              
>Release-Note:
>Audit-Trail:

From: "Andrey V. Elsukov" <bu7cher@yandex.ru>
To: bug-followup@FreeBSD.org, bsd@ask-us.at, phk@freebsd.org,
	maxim@freebsd.org
Cc:  
Subject: Re: bin/92062 : mdconfig(8): mdconfig -l shows 95 entries max.
Date: Tue, 29 Aug 2006 22:36:20 +0400 (MSD)

 Hi!
 
 Can you test this patch?
 
 Index: src/sys/dev/md/md.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/dev/md/md.c,v
 retrieving revision 1.153.2.6
 diff -u -r1.153.2.6 md.c
 --- src/sys/dev/md/md.c 14 Feb 2006 14:46:22 -0000      1.153.2.6
 +++ src/sys/dev/md/md.c 29 Aug 2006 18:33:35 -0000
 @@ -1091,10 +1091,9 @@
         case MDIOCLIST:
                 i = 1;
                 LIST_FOREACH(sc, &md_softc_list, list) {
 -                       if (i == MDNPAD - 1)
 -                               mdio->md_pad[i] = -1;
 -                       else
 -                               mdio->md_pad[i++] = sc->unit;
 +                       if (i < MDNPAD)
 +                               mdio->md_pad[i] = sc->unit;
 +                       i++;
                 }
                 mdio->md_pad[0] = i - 1;
                 return (0);
 
 -- 
 WBR, Andrey V. Elsukov

From: Ruslan Ermilov <ru@FreeBSD.org>
To: "Andrey V. Elsukov" <bu7cher@yandex.ru>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/92062: mdconfig(8): mdconfig -l shows 95 entries max.
Date: Wed, 30 Aug 2006 00:40:43 +0400

 On Tue, Aug 29, 2006 at 06:40:22PM +0000, Andrey V. Elsukov wrote:
 >  Can you test this patch?
 >  
 >  Index: src/sys/dev/md/md.c
 >  ===================================================================
 >  RCS file: /home/ncvs/src/sys/dev/md/md.c,v
 >  retrieving revision 1.153.2.6
 >  diff -u -r1.153.2.6 md.c
 >  --- src/sys/dev/md/md.c 14 Feb 2006 14:46:22 -0000      1.153.2.6
 >  +++ src/sys/dev/md/md.c 29 Aug 2006 18:33:35 -0000
 >  @@ -1091,10 +1091,9 @@
 >          case MDIOCLIST:
 >                  i = 1;
 >                  LIST_FOREACH(sc, &md_softc_list, list) {
 >  -                       if (i == MDNPAD - 1)
 >  -                               mdio->md_pad[i] = -1;
 >  -                       else
 >  -                               mdio->md_pad[i++] = sc->unit;
 >  +                       if (i < MDNPAD)
 >  +                               mdio->md_pad[i] = sc->unit;
 >  +                       i++;
 >                  }
 >                  mdio->md_pad[0] = i - 1;
 >                  return (0);
 >  
 Your patch is against RELENG_6 revision, but MDIOCLIST is only used
 by mdconfig(8) in 5.x.  I think the patch should apply cleanly to
 RELENG_5.  I also think that MDIOCLIST should be removed from HEAD
 and RELENG_6 with an extreme prejudice.
 
 OTOH, your patch, if committed to RELENG_5, will cause the following
 code in 5.x's mdconfig.c to DTRT and print "... %d more".
 
 :         if (ioctl(fd, MDIOCLIST, &mdio) < 0)
 :                 err(1, "ioctl(/dev/%s)", MDCTL_NAME);
 :         for (unit = 0; unit < mdio.md_pad[0] && unit < MDNPAD - 1; unit++) {
 :                 printf("%s%s%d", unit > 0 ? " " : "",
 :                     nflag ? "" : MD_NAME, mdio.md_pad[unit + 1]);
 :         }
 :         if (mdio.md_pad[0] - unit > 0)
 :                 printf(" ... %d more", mdio.md_pad[0] - unit);
 
 
 Cheers,
 -- 
 Ruslan Ermilov
 ru@FreeBSD.org
 FreeBSD committer

From: "Andrey V. Elsukov" <bu7cher@yandex.ru>
To: Ruslan Ermilov <ru@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/92062: mdconfig(8): mdconfig -l shows 95 entries max.
Date: Wed, 30 Aug 2006 08:19:12 +0400

 Ruslan Ermilov wrote:
 > Your patch is against RELENG_6 revision, but MDIOCLIST is only used
  > by mdconfig(8) in 5.x.
 
 Yes, RELENG_6 is on the my working desktop. I've have the same issue
 on RELENEG_6 too. And i see that RELENG_6 use MDIOCLIST too.
 
 > I think the patch should apply cleanly to RELENG_5. 
  > I also think that MDIOCLIST should be removed from HEAD
 > and RELENG_6 with an extreme prejudice.
 
 Patch can be applied cleanly for any three branches.
 
 > OTOH, your patch, if committed to RELENG_5, will cause the following
 > code in 5.x's mdconfig.c to DTRT and print "... %d more".
 
 Yes, i think this is a minimal needed fix. Or MFC :)
 
 -- 
 WBR, Andrey V. Elsukov

From: Ruslan Ermilov <ru@FreeBSD.org>
To: "Andrey V. Elsukov" <bu7cher@yandex.ru>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/92062: mdconfig(8): mdconfig -l shows 95 entries max.
Date: Wed, 30 Aug 2006 12:21:21 +0400

 On Wed, Aug 30, 2006 at 08:19:12AM +0400, Andrey V. Elsukov wrote:
 > Ruslan Ermilov wrote:
 > >Your patch is against RELENG_6 revision, but MDIOCLIST is only used
 > > by mdconfig(8) in 5.x.
 > 
 > Yes, RELENG_6 is on the my working desktop. I've have the same issue
 > on RELENEG_6 too. And i see that RELENG_6 use MDIOCLIST too.
 > 
 > >I think the patch should apply cleanly to RELENG_5. 
 > > I also think that MDIOCLIST should be removed from HEAD
 > >and RELENG_6 with an extreme prejudice.
 > 
 > Patch can be applied cleanly for any three branches.
 > 
 > >OTOH, your patch, if committed to RELENG_5, will cause the following
 > >code in 5.x's mdconfig.c to DTRT and print "... %d more".
 > 
 > Yes, i think this is a minimal needed fix. Or MFC :)
 > 
 Can you try talking to Poul-Henning about this?  If he doesn't
 reply in a reasonable time frame, drop me an email and I will
 take care of it in some way or another.  I'll assign this PR
 to him in hopes to get his attraction.
 
 
 Cheers,
 -- 
 Ruslan Ermilov
 ru@FreeBSD.org
 FreeBSD committer
Responsible-Changed-From-To: freebsd-bugs->phk 
Responsible-Changed-By: ru 
Responsible-Changed-When: Wed Aug 30 22:39:03 UTC 2006 
Responsible-Changed-Why:  
Poul-Henning, can you please look into here and voice your opinion? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=92062 
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Wed Jan 6 16:34:42 UTC 2010 
State-Changed-Why:  
Since r157160 mdconfig(8) uses kern.geom.confxml sysctl to list devices. 
This method is not affected by the reported limitation. 

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