Skip to contentSkip to conversation

net: rename group sysfs entry to netdev_group

RFC PATCH Applied Xiaotian feng 3 participants 6 messages Feb 9, 2011 – Feb 10, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 net: rename group sysfs entry to netdev_group

From: Xiaotian Feng <[email protected]>

commit a512b92 adds sysfs entry for net device group, but
before this commit, tun also uses group sysfs, so after this commit checkin, kernel warns like this:
sysfs: cannot create duplicate filename '/devices/virtual/net/vnet0/group'

Since tun has used this for years, rename sysfs under tun might break existing userspace, so rename group sysfs entry for net device group is a better choice.

Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Tom Herbert <[email protected]>
Cc "Eric W. Biederman" <[email protected]>
Cc Stephen Hemminger <[email protected]>
Cc Vlad Dogaru <[email protected]>
---
 net/core/net-sysfs.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/core/net-sysfs.c +2 -2
index 2e4a393..eb4b5e0 100644
@@ -295,7 +295,7 @@ static ssize_t show_ifalias(struct device *dev,
 	return ret;
 }
 
-NETDEVICE_SHOW(group, fmt_dec);
+NETDEVICE_SHOW(netdev_group, fmt_dec);
 
 static int change_group(struct net_device *net, unsigned long new_group)
 {
@@ -330,7 +330,7 @@ static struct device_attribute net_class_attributes[] = {
 	__ATTR(flags, S_IRUGO | S_IWUSR, show_flags, store_flags),
 	__ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len,
 	       store_tx_queue_len),
-	__ATTR(group, S_IRUGO | S_IWUSR, show_group, store_group),
+	__ATTR(netdev_group, S_IRUGO | S_IWUSR, show_group, store_group),
 	{}
 };
 
Signature · 1 line
1.7.1
maintainer
#1 lore raw

From: Xiaotian feng <[email protected]>
Date: Wed, 9 Feb 2011 18:52:49 +0800

Quoted 7 lines

From: Xiaotian Feng <[email protected]>

commit a512b92 adds sysfs entry for net device group, but
before this commit, tun also uses group sysfs, so after this commit checkin, kernel warns like this:
sysfs: cannot create duplicate filename '/devices/virtual/net/vnet0/group'

Quoted 5 lines

Since tun has used this for years, rename sysfs under tun might break existing userspace, so rename group sysfs entry for net device group is a better choice.

I don't think we have much choice in this matter, so I have applied this patch, thanks!

maintainer
#2 lore raw

From: David Miller <[email protected]>
Date: Wed, 09 Feb 2011 14:03:23 -0800 (PST)

Quoted 10 lines

From: Xiaotian feng <[email protected]>
Date: Wed, 9 Feb 2011 18:52:49 +0800

Quoted 7 lines

From: Xiaotian Feng <[email protected]>

commit a512b92 adds sysfs entry for net device group, but
before this commit, tun also uses group sysfs, so after this commit checkin, kernel warns like this:
sysfs: cannot create duplicate filename '/devices/virtual/net/vnet0/group'

Quoted 8 lines
Quoted 5 lines

Since tun has used this for years, rename sysfs under tun might break existing userspace, so rename group sysfs entry for net device group is a better choice.

I don't think we have much choice in this matter, so I have applied this patch, thanks!

Wait, you didn't even build test this patch?!?!?!?!

net/core/net-sysfs.c: In function ‘format_netdev_group’:
net/core/net-sysfs.c:298: error: ‘const struct net_device’ has no member named ‘netdev_group’ net/core/net-sysfs.c: At top level:
net/core/net-sysfs.c:333: error: ‘show_group’ undeclared here (not in a function)

"RFC" doesn't preclude you from at least build testing patches you post.

Sigh...

#3 lore raw
Quoted 29 lines · David Miller

From: David Miller<[email protected]>
Date: Wed, 09 Feb 2011 14:03:23 -0800 (PST)

Quoted 10 lines

From: Xiaotian feng<[email protected]>
Date: Wed, 9 Feb 2011 18:52:49 +0800

Quoted 7 lines

From: Xiaotian Feng<[email protected]>

commit a512b92 adds sysfs entry for net device group, but
before this commit, tun also uses group sysfs, so after this commit checkin, kernel warns like this:
sysfs: cannot create duplicate filename '/devices/virtual/net/vnet0/group'

Quoted 8 lines
Quoted 5 lines

Since tun has used this for years, rename sysfs under tun might break existing userspace, so rename group sysfs entry for net device group is a better choice.

I don't think we have much choice in this matter, so I have applied this patch, thanks!

Wait, you didn't even build test this patch?!?!?!?!

net/core/net-sysfs.c: In function ‘format_netdev_group’:
net/core/net-sysfs.c:298: error: ‘const struct net_device’ has no member named ‘netdev_group’ net/core/net-sysfs.c: At top level:
net/core/net-sysfs.c:333: error: ‘show_group’ undeclared here (not in a function)

Quoted 5 lines

"RFC" doesn't preclude you from at least build testing patches you post.

Sigh...

Sorry, my bad ... v2 patch is attatched, I've built and r/w this renamed sysfs, all work fine now. Sorry again about my carelessness ...

Regards
Xiaotian

Quoted 4 lines

From 35388da8821a72a71f54cb955146a881f916eb25 Mon Sep 17 00:00:00 2001

From: Xiaotian Feng <[email protected]>
Date: Thu, 10 Feb 2011 10:48:53 +0800
Subject: [PATCH net-next v2] net: rename group sysfs entry to netdev_group

commit a512b92 adds sysfs entry for net device group, but
before this commit, tun also uses group sysfs, so after this commit checkin, kernel warns like this:
sysfs: cannot create duplicate filename '/devices/virtual/net/vnet0/group'

Since tun has used this for years, rename sysfs under tun might break existing userspace, so rename group sysfs entry for net device group is a better choice.

Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Tom Herbert <[email protected]>
Cc "Eric W. Biederman" <[email protected]>
Cc Stephen Hemminger <[email protected]>
Cc Vlad Dogaru <[email protected]>
---
 net/core/net-sysfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/core/net-sysfs.c +1 -1
index 2e4a393..5ceb257 100644
@@ -330,7 +330,7 @@ static struct device_attribute net_class_attributes[] = {
 	__ATTR(flags, S_IRUGO | S_IWUSR, show_flags, store_flags),
 	__ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len,
 	       store_tx_queue_len),
-	__ATTR(group, S_IRUGO | S_IWUSR, show_group, store_group),
+	__ATTR(netdev_group, S_IRUGO | S_IWUSR, show_group, store_group),
 	{}
 };
 
Signature · 1 line
1.7.1
maintainer Applied
#4 lore raw

From: Xiaotian Feng <[email protected]>
Date: Thu, 10 Feb 2011 10:54:35 +0800

Quoted 7 lines

Subject: [PATCH net-next v2] net: rename group sysfs entry to netdev_group

commit a512b92 adds sysfs entry for net device group, but
before this commit, tun also uses group sysfs, so after this commit checkin, kernel warns like this:
sysfs: cannot create duplicate filename '/devices/virtual/net/vnet0/group'

Quoted 5 lines

Since tun has used this for years, rename sysfs under tun might break existing userspace, so rename group sysfs entry for net device group is a better choice.

Applied.

#5 lore raw
In reply to David Miller
Quoted 13 lines · David Miller

From: Xiaotian feng <[email protected]>
Date: Wed, 9 Feb 2011 18:52:49 +0800

Quoted 10 lines

From: Xiaotian Feng <[email protected]>

commit a512b92 adds sysfs entry for net device group, but
before this commit, tun also uses group sysfs, so after this commit checkin, kernel warns like this:
sysfs: cannot create duplicate filename '/devices/virtual/net/vnet0/group'

Since tun has used this for years, rename sysfs under tun might break existing userspace, so rename group sysfs entry for net device group is a better choice.

I was not aware of that, sorry for breaking things :)