Re: [PATCH 1/3] [RFC] genhd: add a new attribute in devicestructure

From: Stefan Richter
Date: Thu Jun 16 2011 - 17:25:55 EST


On Jun 16 Douglas Gilbert wrote:
> One obvious candidate for a preferred block device name
> is:
> - a SATA disk's WWN (NAA 5 64 bit), or
> - a SCSI disk's logical unit name (e.g. SAS: NAA 5)
>
> These names (actually numbers) are meant to be world wide
> unique.
>
> The kernel's device naming (following from how devices are
> discovered) is topological.

I disagree.

1. The kernel name is not about topology. It is from a flat
namespace where nothing else than oder of registration counts.
In some very simple systems there is a deceptively strong correlation
between topology and order of registration. But in the general case
there is no correlation.

2. The persistent worldwide unique name of a device may actually not be
what a particular admin considers a "preferred" name. They may prefer
a topological name ("disk in bay 7") or they may prefer a mnemonic name
from a label on the hardware, invented and tacked on by the vendor
(especially vendor--model name tuples like "Canon MV5i camcorder") or by
the admin themselves, or stored in device memory rather than written
out on a sticker.

Besides, the preference may change from situation to situation. In some
situations, _two_ names are actually required at the same time (besides the
unloved kernel name). So, a "preferred name" as a single datum per device
does not cut it, as also already noted by Kay at the example of the netif
alias.

The retrieval and mapping of the list of "more or less preferred names"
that people realistically use is probably better implemented in userland.
Any kernel solution is bound to impose arbitrary limitations.
--
Stefan Richter
-=====-==-== -==- =----
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/