Subject: Re: devfs, was single user mode file comparisons
To: Greywolf <greywolf@starwolf.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: current-users
Date: 06/09/2003 14:05:51
On Mon, 9 Jun 2003, Greywolf wrote:

> Thus spake Bill Studenmund ("BS> ") sometime Today...
>
> BS> While something like mtree would cover the ownership and permissions, it
> BS> won't handle renaming. The only way to do that is using locators. Once we
> BS> do that, we might as well do it for everything. :-) Also, using locators
> BS> would help with machines connected to SANs. For Fibre Channel, we can use
> BS> WWNs, and for iSCSI we can use target names.
>
> ...could we still hardwire names?  I kind of like knowing where my devices
> actually physically live.
>
> "As an option, of course!"

What exactly would hardwiring names mean?

As long as a device has the same locator, it would automagically get the
same name, ownership, and permissions. That's the point. :-)

So as long as the locator locations stayed the same, devices wouldn't
move around.

For an example, consider a SCSI disk. In the first case, it's on DAS
(Direct-Attached Storage). For now, let's say it had the old-style name
sd0, and its locator is "scsibus1 target 0 lun 0". In what I have in mind,
whatever you (re)name the node for "scsibus1 target 0 lun 0" would always
the same owner and permissions. So all you really need to wire down would
be the locator locations; as long as "scsibus1" was always the same thing,
the disk is always the same. But wait, "scsibus1" is itself a thing with a
locator. :-) Say (looking at one of my boxes) it is "ahc0", which is in
turn "pci0 dev 14 function 0" which is "pci0 at grackle0 bus 0" which is
"grackle0 at mainbus0" which finally is "(root)".

As a second case, consider a SCSI disk on some sort of SAN, either Fibre
Channel or iSCSI. In that case, you really want to be able to have a
locator that uses the WWN or Target Name. That way as your SAN changes,
you always get the same disk. That's the point of those names, after all.
:-)

So hardwiring would certainly be usefull as a transition step, to seed the
devfs.

One open question, with anything that uses locators extensively, which
we don't really need solve until we get closer to code, is what happens if
we change locators/have a discrepency between the userland tree and the
kernel tree. This is a question of policy, so we'll need to be flexible.
My suspicion would be that if you get what looks like something moving
around, you just move it. For insance, you move your SCSI card over one
slot & either leave the old slot empty or put something else there, things
just adapt. Not sure what to do if the SCSI card just disapears..

Take care,

Bill