Skip to contentSkip to conversation

/sys/.../enclosure_device:<something> ?

DISCUSSION Anne Mulhern 2 participants 8 messages Jan 13, 2016 – Jan 18, 2016 1 message not in the archive SCSI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi!

I'm looking for the most precise information available about the meaning of <something> and from what it is derived. I'm also interested in what the values in the files in that directory may mean. Could somebody point me there?

Also, how can there be more than one enclosure_device subdirectory for the same device, or, alternatively, why isn't <something> stored in a file in the more regularly named directory /sys/.../enclosure_device?

(It would be nice to be able to obtain the value of <something> using libudev's attribute lookup facilities, but making that value a part of the specially named directory enclosure_device:<something> makes such a process especially difficult.)

Thanks,

- mulhern

maintainer
#2 lore raw
Quoted 7 lines · Anne Mulhern

Hi!

I'm looking for the most precise information available about the meaning of <something>
and from what it is derived. I'm also interested in what the values in the files in that directory
may mean. Could somebody point me there?

It's in drivers/misc/enclosure.c:enclosure_link_name()

Quoted 5 lines

Also, how can there be more than one enclosure_device subdirectory for the same device,
or, alternatively, why isn't <something> stored in a file in the more regularly named directory
/sys/.../enclosure_device?

I'm not sure I parse the question, but if you're asking how can a single enclosure bay appear to have more than one device, that's when there are multiple paths to the device.

James

Quoted 15 lines

(It would be nice to be able to obtain the value of <something> using libudev's attribute
lookup facilities, but making that value a part of the specially named directory enclosure_device:<something>
makes such a process especially difficult.)

Thanks,

- mulhern
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

----- Original Message -----

Quoted 8 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>, [email protected]
Sent: Wednesday, January 13, 2016 2:15:05 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 2 lines · Anne Mulhern

Hi!

Quoted 8 lines
Quoted 5 lines

I'm looking for the most precise information available about the meaning of <something>
and from what it is derived. I'm also interested in what the values in the files in that directory
may mean. Could somebody point me there?

It's in drivers/misc/enclosure.c:enclosure_link_name()

Thanks. I will do my best with that.

Quoted 9 lines
Quoted 5 lines

Also, how can there be more than one enclosure_device subdirectory for the same device,
or, alternatively, why isn't <something> stored in a file in the more regularly named directory
/sys/.../enclosure_device?

I'm not sure I parse the question, but if you're asking how can a single enclosure bay appear to have more than one device, that's when there are multiple paths to the device.

I'm afraid the word path is so overloaded...I'm assuming that you are talking about a multipathed environment, where two device nodes, say /dev/sdb, /dev/sdc correspond to the same disk, and are hence multipathed. Of course, in that case, it makes sense that both devices should share a bay. And that's what I observe.

If I understand you correctly, then my question is actually the opposite. Why does it look as if the directories are set up so that there can be multiple bays for a single device...i.e., the directory naming scheme allows me to specify an arbitrary number of bays for /dev/sdb. It seems like there should never be more than one?

- mulhern

Quoted 23 lines

James

Quoted 6 lines

(It would be nice to be able to obtain the value of <something> using libudev's attribute
lookup facilities, but making that value a part of the specially named directory enclosure_device:<something>
makes such a process especially difficult.)

Quoted 9 lines

Thanks,

- mulhern
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#4 lore raw
Quoted 38 lines · Anne Mulhern

----- Original Message -----

Quoted 9 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>, [email protected]
Sent: Wednesday, January 13, 2016 2:15:05 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 2 lines · Anne Mulhern

Hi!

Quoted 9 lines
Quoted 6 lines

I'm looking for the most precise information available about the meaning of <something>
and from what it is derived. I'm also interested in what the values
in the files in that directory
may mean. Could somebody point me there?

It's in drivers/misc/enclosure.c:enclosure_link_name()

Thanks. I will do my best with that.

Quoted 8 lines
Quoted 7 lines

Also, how can there be more than one enclosure_device subdirectory
for the same device,
or, alternatively, why isn't <something> stored in a file in the more
regularly named directory
/sys/.../enclosure_device?

Quoted 4 lines

I'm not sure I parse the question, but if you're asking how can a single enclosure bay appear to have more than one device, that's when
there are multiple paths to the device.

Quoted 5 lines

I'm afraid the word path is so overloaded...I'm assuming that you are talking about a multipathed environment, where two device nodes, say /dev/sdb, /dev/sdc correspond to the same disk, and are hence multipathed. Of course, in that case, it makes sense that both devices should share a bay. And that's what I observe.

Yes, that's what I meant.

Quoted 5 lines

If I understand you correctly, then my question is actually the opposite. Why does it look as if the directories are set up so that there can be multiple bays for a single device...i.e., the directory naming scheme allows me to specify an arbitrary number of bays for /dev/sdb. It seems like there should never be more than one?

There is only one bay per device since a physical disk can't be in more than one bay at once. Why do you think it was set up to allow >1?

James

Quoted 35 lines

- mulhern

Quoted 21 lines

James

Quoted 9 lines

(It would be nice to be able to obtain the value of <something> using
libudev's attribute
lookup facilities, but making that value a part of the specially named directory enclosure_device:<something>
makes such a process especially difficult.)

Thanks,

Quoted 9 lines

- mulhern
--
To unsubscribe from this list: send the line "unsubscribe linux -scsi"
in
the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux -scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

----- Original Message -----

Quoted 53 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>
Cc: [email protected]
Sent: Wednesday, January 13, 2016 3:30:07 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 38 lines · Anne Mulhern

----- Original Message -----

Quoted 9 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>, [email protected]
Sent: Wednesday, January 13, 2016 2:15:05 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 2 lines · Anne Mulhern

Hi!

Quoted 9 lines
Quoted 6 lines

I'm looking for the most precise information available about the meaning of <something>
and from what it is derived. I'm also interested in what the values
in the files in that directory
may mean. Could somebody point me there?

It's in drivers/misc/enclosure.c:enclosure_link_name()

Thanks. I will do my best with that.

Quoted 8 lines
Quoted 7 lines

Also, how can there be more than one enclosure_device subdirectory
for the same device,
or, alternatively, why isn't <something> stored in a file in the more
regularly named directory
/sys/.../enclosure_device?

Quoted 4 lines

I'm not sure I parse the question, but if you're asking how can a single enclosure bay appear to have more than one device, that's when
there are multiple paths to the device.

Quoted 5 lines

I'm afraid the word path is so overloaded...I'm assuming that you are talking about a multipathed environment, where two device nodes, say /dev/sdb, /dev/sdc correspond to the same disk, and are hence multipathed. Of course, in that case, it makes sense that both devices should share a bay. And that's what I observe.

Yes, that's what I meant.

Quoted 9 lines
Quoted 5 lines

If I understand you correctly, then my question is actually the opposite. Why does it look as if the directories are set up so that there can be multiple bays for a single device...i.e., the directory naming scheme allows me to specify an arbitrary number of bays for /dev/sdb. It seems like there should never be more than one?

There is only one bay per device since a physical disk can't be in more than one bay at once. Why do you think it was set up to allow >1?

Purely because the naming scheme for the directory, 'enclosure_device:<identifier>' supports more than 1.

This directory pops up in the directory of the parent device representing a block device, and should represent just the bay for that device, AFAIU.

The most compelling reason for this naming scheme to support more than 1 subdirectory is if it is necessary, i.e., there are more than one possible.

That might be true if my understanding of the block device's parent device's meaning is incorrect or if something else doesn't mean what I think it means.

- mulhern

Quoted 43 lines

James

Quoted 29 lines

- mulhern

Quoted 21 lines

James

Quoted 9 lines

(It would be nice to be able to obtain the value of <something> using
libudev's attribute
lookup facilities, but making that value a part of the specially named directory enclosure_device:<something>
makes such a process especially difficult.)

Thanks,

Quoted 9 lines

- mulhern
--
To unsubscribe from this list: send the line "unsubscribe linux -scsi"
in
the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux -scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#6 lore raw
Quoted 89 lines · Anne Mulhern

----- Original Message -----

Quoted 67 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>
Cc: [email protected]
Sent: Wednesday, January 13, 2016 3:30:07 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 42 lines · Anne Mulhern

----- Original Message -----

Quoted 17 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>, [email protected]
Sent: Wednesday, January 13, 2016 2:15:05 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 9 lines · Anne Mulhern

Hi!

I'm looking for the most precise information available about the
meaning of <something>
and from what it is derived. I'm also interested in what the values
in the files in that directory
may mean. Could somebody point me there?

Quoted 2 lines

It's in drivers/misc/enclosure.c:enclosure_link_name()

Thanks. I will do my best with that.

Quoted 9 lines
Quoted 8 lines

Also, how can there be more than one enclosure_device subdirectory
for the same device,
or, alternatively, why isn't <something> stored in a file in the
more
regularly named directory /sys/.../enclosure_device?

Quoted 6 lines

I'm not sure I parse the question, but if you're asking how can a
single enclosure bay appear to have more than one device, that's
when
there are multiple paths to the device.

Quoted 6 lines

I'm afraid the word path is so overloaded...I'm assuming that you are talking about a multipathed environment, where two device nodes,
say /dev/sdb, /dev/sdc correspond to the same disk, and are hence multipathed. Of course, in that case, it makes sense that both devices should share a bay. And that's what I observe.

Yes, that's what I meant.

Quoted 8 lines

If I understand you correctly, then my question is actually the opposite. Why does it look as if the directories are set up so that
there can be multiple bays for a single device...i.e., the directory
naming scheme allows me to specify an arbitrary number of bays for
/dev/sdb. It seems like there should never be more than one?

Quoted 4 lines

There is only one bay per device since a physical disk can't be in more
than one bay at once. Why do you think it was set up to allow >1?

Purely because the naming scheme for the directory, 'enclosure_device:<identifier>' supports more than 1.

This directory pops up in the directory of the parent device representing
a block device, and should represent just the bay for that device, AFAIU.

The most compelling reason for this naming scheme to support more than 1
subdirectory is if it is necessary, i.e., there are more than one possible.

Quoted 4 lines

That might be true if my understanding of the block device's parent device's
meaning is incorrect or if something else doesn't mean what I think it means.

The enclosure_device: is a namespace prefix. It's sysfs, so we can't have two files of the same name and <identifier> is supplied by page 7 of the enclosure device ... it could be anything. The only way to ensure we don't have a clash is to use a namespace prefix.

James

#7 lore raw

Thanks.

Are there any guidelines or rules available regarding the use of namespaces in sysfs that you can refer me to?

I maintain pyudev, which is a python wrapper around libudev with some added conveniences, and I'm wondering if there is some functionality around namespaces that could be usefully added.

- mulhern

----- Original Message -----

Quoted 113 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>
Cc: [email protected]
Sent: Friday, January 15, 2016 2:38:05 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 89 lines · Anne Mulhern

----- Original Message -----

Quoted 67 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>
Cc: [email protected]
Sent: Wednesday, January 13, 2016 3:30:07 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 42 lines · Anne Mulhern

----- Original Message -----

Quoted 17 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>, [email protected]
Sent: Wednesday, January 13, 2016 2:15:05 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 9 lines · Anne Mulhern

Hi!

I'm looking for the most precise information available about the
meaning of <something>
and from what it is derived. I'm also interested in what the values
in the files in that directory
may mean. Could somebody point me there?

Quoted 2 lines

It's in drivers/misc/enclosure.c:enclosure_link_name()

Thanks. I will do my best with that.

Quoted 9 lines
Quoted 8 lines

Also, how can there be more than one enclosure_device subdirectory
for the same device,
or, alternatively, why isn't <something> stored in a file in the
more
regularly named directory /sys/.../enclosure_device?

Quoted 6 lines

I'm not sure I parse the question, but if you're asking how can a
single enclosure bay appear to have more than one device, that's
when
there are multiple paths to the device.

Quoted 6 lines

I'm afraid the word path is so overloaded...I'm assuming that you are talking about a multipathed environment, where two device nodes,
say /dev/sdb, /dev/sdc correspond to the same disk, and are hence multipathed. Of course, in that case, it makes sense that both devices should share a bay. And that's what I observe.

Yes, that's what I meant.

Quoted 8 lines

If I understand you correctly, then my question is actually the opposite. Why does it look as if the directories are set up so that
there can be multiple bays for a single device...i.e., the directory
naming scheme allows me to specify an arbitrary number of bays for
/dev/sdb. It seems like there should never be more than one?

Quoted 4 lines

There is only one bay per device since a physical disk can't be in more
than one bay at once. Why do you think it was set up to allow >1?

Purely because the naming scheme for the directory, 'enclosure_device:<identifier>' supports more than 1.

This directory pops up in the directory of the parent device representing
a block device, and should represent just the bay for that device, AFAIU.

The most compelling reason for this naming scheme to support more than 1
subdirectory is if it is necessary, i.e., there are more than one possible.

Quoted 4 lines

That might be true if my understanding of the block device's parent device's
meaning is incorrect or if something else doesn't mean what I think it means.

The enclosure_device: is a namespace prefix. It's sysfs, so we can't have two files of the same name and <identifier> is supplied by page 7 of the enclosure device ... it could be anything. The only way to ensure we don't have a clash is to use a namespace prefix.

James

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#8 lore raw
Quoted 4 lines · Anne Mulhern

Thanks.

Are there any guidelines or rules available regarding the use of namespaces in sysfs that you can refer me to?

I don't believe there are any, sorry. What I'm describing isn't really true namespacing, it's using namespace techniques to avoid potential unique name clashes. There's nothing formally documented about this in sysfs-rules.txt; it is simply the type of thing that often gets done to avoid unique name issues in filesystems.

James

Quoted 146 lines

I maintain pyudev, which is a python wrapper around libudev with some added conveniences, and I'm wondering if there is some functionality around namespaces that could be usefully added.

- mulhern

----- Original Message -----

Quoted 124 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>
Cc: [email protected]
Sent: Friday, January 15, 2016 2:38:05 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 103 lines · Anne Mulhern

----- Original Message -----

Quoted 78 lines

From: "James Bottomley" <[email protected]>
To: "Anne Mulhern" <[email protected]>
Cc: [email protected]
Sent: Wednesday, January 13, 2016 3:30:07 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 47 lines · Anne Mulhern

----- Original Message -----

Quoted 20 lines

From: "James Bottomley" < [email protected]>
To: "Anne Mulhern" <[email protected]>, [email protected]
Sent: Wednesday, January 13, 2016 2:15:05 PM
Subject: Re: /sys/.../enclosure_device:<something> ?

Quoted 11 lines · Anne Mulhern

Hi!

I'm looking for the most precise information available about
the
meaning of <something>
and from what it is derived. I'm also interested in what the
values
in the files in that directory
may mean. Could somebody point me there?

Quoted 2 lines

It's in drivers/misc/enclosure.c:enclosure_link_name()

Thanks. I will do my best with that.

Quoted 10 lines
Quoted 9 lines

Also, how can there be more than one enclosure_device subdirectory
for the same device,
or, alternatively, why isn't <something> stored in a file in
the
more
regularly named directory /sys/.../enclosure_device?

Quoted 7 lines

I'm not sure I parse the question, but if you're asking how can
a
single enclosure bay appear to have more than one device, that's
when
there are multiple paths to the device.

Quoted 9 lines

I'm afraid the word path is so overloaded...I'm assuming that you
are talking about a multipathed environment, where two device nodes,
say /dev/sdb, /dev/sdc correspond to the same disk, and are hence
multipathed. Of course, in that case, it makes sense that both
devices should share a bay. And that's what I observe.

Yes, that's what I meant.

Quoted 11 lines

If I understand you correctly, then my question is actually the
opposite. Why does it look as if the directories are set up so
that
there can be multiple bays for a single device...i.e., the directory
naming scheme allows me to specify an arbitrary number of bays
for
/dev/sdb. It seems like there should never be more than one?

Quoted 6 lines

There is only one bay per device since a physical disk can't be in
more
than one bay at once. Why do you think it was set up to allow

Quoted 1 line

1?

Purely because the naming scheme for the directory, 'enclosure_device:<identifier>' supports more than 1.

This directory pops up in the directory of the parent device representing
a block device, and should represent just the bay for that device,
AFAIU.

The most compelling reason for this naming scheme to support more than 1
subdirectory is if it is necessary, i.e., there are more than one possible.

Quoted 6 lines

That might be true if my understanding of the block device's parent
device's
meaning is incorrect or if something else doesn't mean what I think
it means.

The enclosure_device: is a namespace prefix. It's sysfs, so we can't
have two files of the same name and <identifier> is supplied by page 7
of the enclosure device ... it could be anything. The only way to ensure we don't have a clash is to use a namespace prefix.

Quoted 8 lines

James

--
To unsubscribe from this list: send the line "unsubscribe linux -scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html