Skip to contentSkip to conversation

add rules for new aoe character devices

PATCH Ed L. Cashin 3 participants 8 messages Nov 29, 2007 – Dec 10, 2007

lore
Share & tools
lore
#0 lore raw

The patch below adds support for new aoe driver character "flush" and "revalidate" devices to the existing aoe rules in udev-117.

The current aoe driver version in the Linux kernel does not include the "flush" feature, but I have already submitted patches to the LKML adding that support and am now working on updating those patches for resubmission. Those using the aoe driver on the Coraid website already have the "flush" feature.

Signature · 2 lines
  Support - http://www.coraid.com/support/howto.html
  Ed L Cashin <[email protected]>
etc/udev/debian/devfs.rules +1 -0
diff -upr udev-117.orig/etc/udev/debian/devfs.rules udev-117/etc/udev/debian/devfs.rules
@@ -148,6 +148,7 @@ SUBSYSTEM=="aoe", KERNEL=="discover",	NA
 SUBSYSTEM=="aoe", KERNEL=="err",	NAME="etherd/%k"
 SUBSYSTEM=="aoe", KERNEL=="interfaces",	NAME="etherd/%k"
 SUBSYSTEM=="aoe", KERNEL=="revalidate",	NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="flush",     NAME="etherd/%k"
 
 # device mapper creates its own device nodes, so ignore these
 KERNEL=="device-mapper",	NAME="mapper/control"
etc/udev/debian/udev.rules +1 -0
diff -upr udev-117.orig/etc/udev/debian/udev.rules udev-117/etc/udev/debian/udev.rules
@@ -97,6 +97,7 @@ SUBSYSTEM=="aoe", KERNEL=="discover",	NA
 SUBSYSTEM=="aoe", KERNEL=="err",	NAME="etherd/%k"
 SUBSYSTEM=="aoe", KERNEL=="interfaces",	NAME="etherd/%k"
 SUBSYSTEM=="aoe", KERNEL=="revalidate",	NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="flush",     NAME="etherd/%k"
 
 # device mapper creates its own device nodes, so ignore these
 KERNEL=="device-mapper",	NAME="mapper/control"
etc/udev/slackware/udev.rules +2 -0
diff -upr udev-117.orig/etc/udev/slackware/udev.rules udev-117/etc/udev/slackware/udev.rules
@@ -148,6 +148,8 @@ KERNEL=="md[0-9]*",	NAME="md/%n", SYMLIN
 SUBSYSTEM=="aoe", KERNEL=="discover",	NAME="etherd/%k", GROUP="disk", MODE="0220"
 SUBSYSTEM=="aoe", KERNEL=="err",	NAME="etherd/%k", GROUP="disk", MODE="0440"
 SUBSYSTEM=="aoe", KERNEL=="interfaces",	NAME="etherd/%k", GROUP="disk", MODE="0220"
+SUBSYSTEM=="aoe", KERNEL=="revalidate",	NAME="etherd/%k", GROUP="disk", MODE="0220"
+SUBSYSTEM=="aoe", KERNEL=="flush",	NAME="etherd/%k", GROUP="disk", MODE="0220"
 
 # netlink devices
 KERNEL=="route",	NAME="netlink/%k"

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 8 lines · Ed L. Cashin

The patch below adds support for new aoe driver character "flush" and "revalidate" devices to the existing aoe rules in udev-117.

The current aoe driver version in the Linux kernel does not include the "flush" feature, but I have already submitted patches to the LKML adding that support and am now working on updating those patches for resubmission. Those using the aoe driver on the Coraid website already have the "flush" feature.

The distro rules are just a copy from the distro packages and changes made here will not get into the packages. We can add the rules only to the "default" rules.

Does this rule work for you? It should move all nodes into a subdir:
SUBSYSTEM="aoe", NAME="etherd/%k"

Kay

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Ed L. Cashin
Quoted 10 lines · Kay Sievers
Quoted 8 lines · Ed L. Cashin

The patch below adds support for new aoe driver character "flush" and "revalidate" devices to the existing aoe rules in udev-117.

The current aoe driver version in the Linux kernel does not include the "flush" feature, but I have already submitted patches to the LKML adding that support and am now working on updating those patches for resubmission. Those using the aoe driver on the Coraid website already have the "flush" feature.

Quoted 3 lines

The distro rules are just a copy from the distro packages and changes made here will not get into the packages. We can add the rules only to the "default" rules.

Ah. Thank you.

Quoted 2 lines

Does this rule work for you? It should move all nodes into a subdir:
SUBSYSTEM="aoe", NAME="etherd/%k"

Yes, that's good for the block devices. In the past it seems that rule doesn't guarantee the creation of the character device nodes, though, and that is why there is a separate rule for each character node in the patch I sent. I haven't checked yet whether the latest udev and kernel still behave the same way.

Signature · 12 lines
  Support - http://www.coraid.com/support/howto.html
  Ed L Cashin <[email protected]>

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#3 lore raw
In reply to Ed L. Cashin
Quoted 17 lines · Ed L. Cashin
Quoted 10 lines · Kay Sievers
Quoted 8 lines · Ed L. Cashin

The patch below adds support for new aoe driver character "flush" and "revalidate" devices to the existing aoe rules in udev-117.

The current aoe driver version in the Linux kernel does not include the "flush" feature, but I have already submitted patches to the LKML adding that support and am now working on updating those patches for resubmission. Those using the aoe driver on the Coraid website already have the "flush" feature.

Quoted 3 lines

The distro rules are just a copy from the distro packages and changes made here will not get into the packages. We can add the rules only to the "default" rules.

Ah. Thank you.

Quoted 8 lines
Quoted 2 lines

Does this rule work for you? It should move all nodes into a subdir:
SUBSYSTEM="aoe", NAME="etherd/%k"

Yes, that's good for the block devices. In the past it seems that rule doesn't guarantee the creation of the character device nodes, though, and that is why there is a separate rule for each character node in the patch I sent. I haven't checked yet whether the latest udev and kernel still behave the same way.

Block devices always have SUBSYSTEM="block", this will only handle the char devices. You want the block devices to be in a subdir?

Kay

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Ed L. Cashin
Quoted 27 lines · Kay Sievers
Quoted 17 lines · Ed L. Cashin
Quoted 10 lines · Kay Sievers
Quoted 8 lines · Ed L. Cashin

The patch below adds support for new aoe driver character "flush" and "revalidate" devices to the existing aoe rules in udev-117.

The current aoe driver version in the Linux kernel does not include the "flush" feature, but I have already submitted patches to the LKML adding that support and am now working on updating those patches for resubmission. Those using the aoe driver on the Coraid website already have the "flush" feature.

Quoted 3 lines

The distro rules are just a copy from the distro packages and changes made here will not get into the packages. We can add the rules only to the "default" rules.

Ah. Thank you.

Quoted 8 lines
Quoted 2 lines

Does this rule work for you? It should move all nodes into a subdir:
SUBSYSTEM="aoe", NAME="etherd/%k"

Yes, that's good for the block devices. In the past it seems that rule doesn't guarantee the creation of the character device nodes, though, and that is why there is a separate rule for each character node in the patch I sent. I haven't checked yet whether the latest udev and kernel still behave the same way.

Quoted 4 lines

Block devices always have SUBSYSTEM="block", this will only handle the char devices. You want the block devices to be in a subdir?

Kay

The rules we had in the old gentoo rules file seems to care only about the aoe char-devices.

# aoe char devices,
SUBSYSTEM="aoe", KERNEL="discover",	NAME="etherd/%k", GROUP="disk", 
MODE="0220"
SUBSYSTEM="aoe", KERNEL="err",	NAME="etherd/%k", GROUP="disk", MODE="0440"
SUBSYSTEM="aoe", KERNEL="interfaces",	NAME="etherd/%k", GROUP="disk", 
MODE="0220"

So I also suggest to add something like
SUBSYSTEM="aoe", NAME="etherd/%k", GROUP="disk"

No idea if MODE is really needed like done in the old rules.
As I think: If the drivers are written properly they should only allow reading or writing (as needed) without setting it like above.
I suggest to add GROUP=disk as I think these control devices are similar to raw sg, raw and tape devices.

Matthias

Signature · 12 lines
Matthias Schwarzott (zzam)


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#5 lore raw
In reply to Ed L. Cashin
Quoted 2 lines · Kay Sievers
Quoted 1 line · Ed L. Cashin

On Mon, Dec 03, 2007 at 07:15:03PM +0100, Kay Sievers wrote:

...

Quoted 11 lines
Quoted 8 lines
Quoted 2 lines

Does this rule work for you? It should move all nodes into a subdir:
SUBSYSTEM="aoe", NAME="etherd/%k"

Yes, that's good for the block devices. In the past it seems that rule doesn't guarantee the creation of the character device nodes, though, and that is why there is a separate rule for each character node in the patch I sent. I haven't checked yet whether the latest udev and kernel still behave the same way.

Block devices always have SUBSYSTEM="block", this will only handle the char devices. You want the block devices to be in a subdir?

Yes, the normal arrangement is for the "etherd" subdirectory in /dev to contain the character and block devices for the aoe driver. It looks like,

  ecashin@ellijay:~$ ls -l /dev/etherd 
  total 0
  c-w--w---- 1 root disk 152,  3 Dec  7 16:24 discover
  brw-rw---- 1 root disk 152, 16 Dec  7 17:02 e7.0
  brw-rw---- 1 root disk 152,  0 Dec  7 17:02 e7.1
  cr--r----- 1 root disk 152,  2 Dec  7 16:24 err
  c-w--w---- 1 root disk 152,  6 Dec  7 16:24 flush
  c-w--w---- 1 root disk 152,  4 Dec  7 16:24 interfaces
  c-w--w---- 1 root disk 152,  5 Dec  7 16:24 revalidate
  ecashin@ellijay:~$ 

(The block device minor numbers are different for this aoe6-55 driver than they would be for earlier versions. This aoe6-55 driver relies on udev and assigns minor numbers dynamically. Older drivers can't do that, and so have a more limited range of possible AoE shelf and slot addresses.)

Signature · 13 lines
  Support - http://www.coraid.com/support/howto.html
  Ed L Cashin <[email protected]>

-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#6 lore raw
In reply to Ed L. Cashin
Quoted 31 lines · Ed L. Cashin
Quoted 2 lines · Kay Sievers
Quoted 1 line · Ed L. Cashin

On Mon, Dec 03, 2007 at 07:15:03PM +0100, Kay Sievers wrote:

...

Quoted 11 lines
Quoted 8 lines
Quoted 2 lines

Does this rule work for you? It should move all nodes into a subdir:
SUBSYSTEM="aoe", NAME="etherd/%k"

Yes, that's good for the block devices. In the past it seems that rule doesn't guarantee the creation of the character device nodes, though, and that is why there is a separate rule for each character node in the patch I sent. I haven't checked yet whether the latest udev and kernel still behave the same way.

Block devices always have SUBSYSTEM="block", this will only handle the char devices. You want the block devices to be in a subdir?

Yes, the normal arrangement is for the "etherd" subdirectory in /dev to contain the character and block devices for the aoe driver. It looks like,

  ecashin@ellijay:~$ ls -l /dev/etherd 
  total 0
  c-w--w---- 1 root disk 152,  3 Dec  7 16:24 discover
  brw-rw---- 1 root disk 152, 16 Dec  7 17:02 e7.0
  brw-rw---- 1 root disk 152,  0 Dec  7 17:02 e7.1
  cr--r----- 1 root disk 152,  2 Dec  7 16:24 err
  c-w--w---- 1 root disk 152,  6 Dec  7 16:24 flush
  c-w--w---- 1 root disk 152,  4 Dec  7 16:24 interfaces
  c-w--w---- 1 root disk 152,  5 Dec  7 16:24 revalidate
  ecashin@ellijay:~$ 
Quoted 5 lines

(The block device minor numbers are different for this aoe6-55 driver than they would be for earlier versions. This aoe6-55 driver relies on udev and assigns minor numbers dynamically. Older drivers can't do that, and so have a more limited range of possible AoE shelf and slot addresses.)

I see, the block device nodes have the "etherd/" prefix in the kernel, so they don't need a udev rule to move them there. The name in sysfs has a '!', like "/sys/block/etherd!e7.0/", right?

Kay

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#7 lore raw
In reply to Ed L. Cashin

On Mon, Dec 10, 2007 at 08:21:48PM +0100, Kay Sievers wrote:
...

Quoted 3 lines

I see, the block device nodes have the "etherd/" prefix in the kernel, so they don't need a udev rule to move them there. The name in sysfs has a '!', like "/sys/block/etherd!e7.0/", right?

Yes, you are quite right.

  ellijay:/tmp/aoett# ls -ld /sys/block/*e*.*
  drwxr-xr-x 3 root root 0 Dec 10 11:31 /sys/block/etherd!e7.0
  drwxr-xr-x 3 root root 0 Dec 10 11:31 /sys/block/etherd!e7.1
Signature · 12 lines
  Ed L Cashin <[email protected]>

-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel