From owner-freebsd-arch Sat Dec 22 15: 8:15 2001 Delivered-To: freebsd-arch@freebsd.org Received: from tomts14-srv.bellnexxia.net (tomts14.bellnexxia.net [209.226.175.35]) by hub.freebsd.org (Postfix) with ESMTP id EE3DA37B405; Sat, 22 Dec 2001 15:08:08 -0800 (PST) Received: from khan.anarcat.dyndns.org ([65.94.189.35]) by tomts14-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20011222230808.TITR6216.tomts14-srv.bellnexxia.net@khan.anarcat.dyndns.org>; Sat, 22 Dec 2001 18:08:08 -0500 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 5B0121B43; Sat, 22 Dec 2001 18:08:03 -0500 (EST) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 7998720ACB; Sat, 22 Dec 2001 18:08:01 -0500 (EST) Date: Sat, 22 Dec 2001 18:08:00 -0500 From: The Anarcat To: arch@freebsd.org Cc: jkh@freebsd.org Subject: sysctl kern.disks shouldn't have to sort its output Message-ID: <20011222230759.GD530@shall.anarcat.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3O1VwFp74L81IIeR" Content-Disposition: inline User-Agent: Mutt/1.3.24i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --3O1VwFp74L81IIeR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi. I'm struggling with a breakage in libh which is due to some code committed recently to -stable libdisk and then MFS'd to -current: -- snip -- revision 1.50.2.14 date: 2001/09/18 06:47:30; author: jkh; state: Exp; lines: +2 -2 Temporarily disable the use of kern.disks - it returns the disk devices in the wrong order and causes them to be displayed out of sequence in sysinstall. The right fix is to sort that info in the kernel, this is just a stop-gap measure which falls back to the code which always ran prior to kern.disks existing. This deliberately not committed to -current because we have aple time to pursue the right fix in that branch. -- snip -- The breakage is that the "alternate drive detection routine" uses a open call on the drive device to verify that it exists. It is not only inefficient, but also disables detection for non-root processes. Ok, now, i'm not sure about that, but looking at how kern.disks is implemented (a simple list to which disks are added one by one) and how sysctl_disks is implemented (iteration through that list), it seems a pain to sort these entries there. To me, the sorting belongs to libdisk at most, or to the user app. Not in the kernel. Of course, one might wonder why the entries in kern.disks are not sorted. This, I do not know. It might depend on how the disks are detected. For example, here, sysctl kern.disks gives: kern.disks: cd0 ad3 ad1 ad0 md0 ad3 is on ata1. So maybe ata1 is detected first and that's why the disk ends up there. I don't know. Anyways. If the sorting belongs to the kernel, I could do it. However, I think it belongs to libdisk, so I'll start working on a patch there. Just FYI, a. --3O1VwFp74L81IIeR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjwlEkwACgkQttcWHAnWiGfq9gCdE67OTyktP7Ec2nv5JiY/Qjom RaoAn2ztR7R2b3Qp9Q1gTf0Z10RSmUV3 =u5Qh -----END PGP SIGNATURE----- --3O1VwFp74L81IIeR-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message