All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: James.Smart@Emulex.Com
Cc: Greg KH <greg@kroah.com>, Andrew Morton <akpm@osdl.org>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: RE: [PATCH] add transport class symlink to device object
Date: Sun, 14 Aug 2005 09:17:50 -0500	[thread overview]
Message-ID: <1124029070.18802.6.camel@mulgrave> (raw)
In-Reply-To: <9BB4DECD4CFE6D43AA8EA8D768ED51C201AD36@xbl3.ma.emulex.com>

On Sun, 2005-08-14 at 08:42 -0400, James.Smart@Emulex.Com wrote:
> I'll trust that James B's fix resolves things. Thought my testing was
> straight-forward and ok. Guess not. Humbled again as a mere mortal in
> the world of sysfs and transport/container logic... :)

Well ... I confidently predict that you only tested in an all fibre
environment.  The bug only shows up with scanning (which we no longer do
for fibre).

> - Visually, I get more meaning out of seeing the class's name, than
>   what is usually a redundant object name (many device and class
>   objects have the same name).

This is also an argument for a directory rather than a prefix.

> - If a device could ever be associated with more than 1 class, it's
>   supported (and no issues of name collision).

This is a killer reason for not using the other class.  We allow this,
and already have several examples.  The host device, for instance is a
member of both the spi_host class and the scsi_host class.  Indeed, you
can see the problem with Greg's original patch:

titanic:~# ls -l /sys/class/scsi_host/host0/device/
total 0
lrwxrwxrwx  1 root root 0 Aug 14 09:05 host0 -> ../../../../class/spi_host/host0
lrwxrwxrwx  1 root root 0 Aug 14 09:05 host0 -> ../../../../class/spi_host/host0
drwxr-xr-x  2 root root 0 Aug 14 09:02 power

In fact, not naming the link after the class is particularly daft since
the object is to tell you what classes a device belongs to.

By contrast, this is what you get under James' patch:

titanic:~# ls -l /sys/class/scsi_host/host0/device/
total 0
lrwxrwxrwx  1 root root 0 Aug 14 09:16 class:scsi_host -> ../../../../class/scsi_host/host0
lrwxrwxrwx  1 root root 0 Aug 14 09:16 class:spi_host -> ../../../../class/spi_host/host0
drwxr-xr-x  2 root root 0 Aug 14 09:13 power

> - The prefix of "class:" highlights what it is; makes it harder to lose
>   in a long list of attributes; gives a simple handle for regex
>   parsing (ex: "ls class*"); and helps avoid name collision with other
>   attributes.

> - The class object's name is always derivable from what the symlink
>   points to.

Again, I think this one is a requirement.

James



  reply	other threads:[~2005-08-14 14:18 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-14 12:42 [PATCH] add transport class symlink to device object James.Smart
2005-08-14 14:17 ` James Bottomley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-08-18 11:32 James.Smart
2005-08-18 11:32 ` James.Smart
2005-08-18 11:31 James.Smart
2005-08-18 11:31 ` James.Smart
2005-08-16 15:50 James.Smart
2005-08-16 15:50 ` James.Smart
2005-08-16  0:52 James.Smart
2005-08-16  0:52 ` James.Smart
2005-08-16  1:08 ` James Bottomley
2005-08-16 13:41   ` Luben Tuikov
2005-08-16 13:37 ` Luben Tuikov
2005-08-16 20:53   ` Russell King
2005-08-13 15:34 James.Smart
2005-08-13 21:39 ` Greg KH
2005-08-13 23:36   ` James Bottomley
2005-08-14  0:42     ` James Bottomley
2005-08-14  1:37       ` James Bottomley
2005-08-14 15:02   ` Matthew Wilcox
2005-08-14 22:25     ` Russell King
2005-08-15  0:43       ` Matthew Wilcox
2005-08-15  8:32         ` Russell King
2005-08-18  5:21           ` Greg KH
2005-08-18  6:30             ` Russell King
2005-08-18  6:41               ` Greg KH
2005-08-18  6:50                 ` Russell King
2005-08-18  7:04                   ` Greg KH
2005-08-18 11:43                     ` Matthew Wilcox
2005-08-15 22:41     ` James Bottomley
2005-08-18  5:23       ` Greg KH
2005-08-18  6:37         ` Greg KH
2005-08-18 19:50           ` Dmitry Torokhov
2005-08-31 21:43             ` Greg KH
2005-09-01  5:57               ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1124029070.18802.6.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=James.Smart@Emulex.Com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.