From owner-freebsd-arch@FreeBSD.ORG Mon Jun 26 06:51:44 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F400E16A408; Mon, 26 Jun 2006 06:51:43 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81A8343D62; Mon, 26 Jun 2006 06:51:43 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id BB4031703F; Mon, 26 Jun 2006 06:51:41 +0000 (UTC) To: John-Mark Gurney From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 25 Jun 2006 20:16:37 MST." <20060626031636.GK82074@funkthat.com> Date: Mon, 26 Jun 2006 06:51:37 +0000 Message-ID: <33398.1151304697@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: pjd@freebsd.org, freebsd-arch@freebsd.org Subject: Re: Accessing disks via their serial numbers. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2006 06:51:44 -0000 In message <20060626031636.GK82074@funkthat.com>, John-Mark Gurney writes: >Can't we expand the disk api? add a const char *d_serial to the struct >disk, and have the disk api automaticly propegate the serial number up >to the geom layer? This is more or less what Pawel asked me for, and I am not at all convinced that is how we want to do it. There are several attributes which could be relevant in a context like what Pawel proposes, the serial number (which one ? drive or media ?) the physical address cam-{bus,id,lun}, FC WWN's and so on. If we disregard mechanism for a moment, and assume that g_label gets hold of the info and creates label devices matching these various informations, then we have to address the problem of obsesity in the geom mesh: In addition to ad0, ad0s1 and ad0s1a we will then have label/SOMESERIAL, label/SOMESERIALs1, label/SOMESERIALs1a etc etc. The better way of implementing it is by using the devfs 'device-on-demand' facility to create symlinks to the geom_dev nodes based on specific lookups, that would not pollute /dev with nodes people don't really use and it would avoid the combinatorial explosion of the geom mesh. And this brings me to the next point: As nice as this feature sounds to begin with, is it really useful in practice ? I suspect that the proponents of this scheme will object to my proposal because they can not do a "ls /dev/mumble/*" to get a list of disk serial numbers, and if so, that dooms the proposal: If the only objective is to get a list of serial numbers, then this is not how it should be done, instead we should add a real VPD registry to the kernel. Summary: I'm against until somebody have explained what the use is, and if use is proven, it should be done with devfs device-on-demand(/cloning) instead of g_label. Poul-Henning -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.