tun: Failed to create tun sysfs files [was: mmotm 2011-03-02-16-52 uploaded]

8 messages, 4 authors, 2011-03-07 · open the first message on its own page

tun: Failed to create tun sysfs files [was: mmotm 2011-03-02-16-52 uploaded]

From: Jiri Slaby <hidden>
Date: 2011-03-04 08:56:15

On 03/03/2011 01:52 AM, akpm@linux-foundation.org wrote:
The mm-of-the-moment snapshot 2011-03-02-16-52 has been uploaded to
Hi, I'm seeing this with tun (also with earlier versions):
WARNING: at fs/sysfs/dir.c:455 sysfs_add_one+0xb8/0xe0()
Hardware name: To Be Filled By O.E.M.
sysfs: cannot create duplicate filename '/devices/virtual/net/tun0/group'
Modules linked in: microcode dvb_usb_af9015 tda18271 af9013 dvb_usb dvb_core
Pid: 3840, comm: openvpn Not tainted 2.6.38-rc4-mm1_64+ #1390
Call Trace:
 [<ffffffff8106d61a>] ? warn_slowpath_common+0x7a/0xb0
 [<ffffffff8106d6f1>] ? warn_slowpath_fmt+0x41/0x50
 [<ffffffff81176638>] ? sysfs_add_one+0xb8/0xe0
 [<ffffffff8117570d>] ? sysfs_add_file_mode+0x5d/0xa0
 [<ffffffff8117575c>] ? sysfs_add_file+0xc/0x10
 [<ffffffff81175841>] ? sysfs_create_file+0x21/0x40
 [<ffffffff813609d4>] ? device_create_file+0x14/0x20
 [<ffffffff813e0256>] ? tun_set_iff+0x3f6/0x4a0
 [<ffffffff813e05fe>] ? __tun_chr_ioctl+0x12e/0x5d0
 [<ffffffff8126c5c2>] ? __strncpy_from_user+0x22/0x60
 [<ffffffff813e0ade>] ? tun_chr_ioctl+0xe/0x10
 [<ffffffff811274ed>] ? do_vfs_ioctl+0x8d/0x300
 [<ffffffff811277aa>] ? sys_ioctl+0x4a/0x80
 [<ffffffff81030dbb>] ? system_call_fastpath+0x16/0x1b

It's because these devices already contain 'group' in the sysfs dir.

regards,
-- 
js
suse labs

Re: tun: Failed to create tun sysfs files

From: David Miller <davem@davemloft.net>
Date: 2011-03-04 09:05:33

From: Jiri Slaby <redacted>
Date: Fri, 04 Mar 2011 09:56:09 +0100
On 03/03/2011 01:52 AM, akpm@linux-foundation.org wrote:
quoted
The mm-of-the-moment snapshot 2011-03-02-16-52 has been uploaded to
Hi, I'm seeing this with tun (also with earlier versions):
The name of the attribute was changed to netdev_group in order to
fix this problem, in fact quite some time ago.

See the last entry of the net_class_attributes array in
net/core/net-sysfs.c, if it isn't called "netdev_group"
something is awry.

Re: tun: Failed to create tun sysfs files

From: Jiri Slaby <hidden>
Date: 2011-03-04 09:37:39

On 03/04/2011 10:06 AM, David Miller wrote:
From: Jiri Slaby <redacted>
Date: Fri, 04 Mar 2011 09:56:09 +0100
quoted
On 03/03/2011 01:52 AM, akpm@linux-foundation.org wrote:
quoted
The mm-of-the-moment snapshot 2011-03-02-16-52 has been uploaded to
Hi, I'm seeing this with tun (also with earlier versions):
The name of the attribute was changed to netdev_group in order to
fix this problem, in fact quite some time ago.

See the last entry of the net_class_attributes array in
net/core/net-sysfs.c, if it isn't called "netdev_group"
something is awry.
<idiocy>
Aha, sorry for the noise, I booted the old kernel.
</idiocy>

thanks,
-- 
js

tun routing is broken [was: tun: Failed to create tun sysfs files]

From: Jiri Slaby <hidden>
Date: 2011-03-05 08:04:28

On 03/04/2011 10:37 AM, Jiri Slaby wrote:
On 03/04/2011 10:06 AM, David Miller wrote:
quoted
From: Jiri Slaby <redacted>
Date: Fri, 04 Mar 2011 09:56:09 +0100
quoted
On 03/03/2011 01:52 AM, akpm@linux-foundation.org wrote:
quoted
The mm-of-the-moment snapshot 2011-03-02-16-52 has been uploaded to
Hi, I'm seeing this with tun (also with earlier versions):
The name of the attribute was changed to netdev_group in order to
fix this problem, in fact quite some time ago.

See the last entry of the net_class_attributes array in
net/core/net-sysfs.c, if it isn't called "netdev_group"
something is awry.
<idiocy>
Aha, sorry for the noise, I booted the old kernel.
</idiocy>
Ok, so I booted the new kernel, and tun is broken there completely. If I
try to ping a vpn peer:
...
capget(0x20080522, 0, NULL)             = 0
capset(0x20080522, 0, {0, 0, 0})        = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(1025),
sin_addr=inet_addr("10.20.11.1")}, 16) = -1 EINVAL (Invalid argument)

the route is:
10.20.11.1 dev tun0  proto kernel  scope link  src 10.20.11.33

When I try to ping a router on eth0 10.0.28.10, it works as expected.

Maybe the changes in ipv4 routing cause this? But my amateur eyes can't
see any breakage there...

Now I'm back in mmotm 2011-02-10-16-26 and it works, indeed.

regards,
-- 
js
suse labs

Re: tun routing is broken

From: David Miller <davem@davemloft.net>
Date: 2011-03-05 08:09:46

From: Jiri Slaby <redacted>
Date: Sat, 05 Mar 2011 09:04:22 +0100
Ok, so I booted the new kernel, and tun is broken there completely. If I
try to ping a vpn peer:
-mm tree is missing this fix which went in yesterday.  Please if
you are going to be testing networking a lot, test against net-next-2.6
instead of Andrew's tree which invariable lags behind:

--------------------
ipv4: Fix __ip_dev_find() to use ifa_local instead of ifa_address.

Reported-by: Stephen Hemminger <redacted>
Reported-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv4/devinet.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 9038928..ff53860 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -111,7 +111,7 @@ static inline unsigned int inet_addr_hash(struct net *net, __be32 addr)
 
 static void inet_hash_insert(struct net *net, struct in_ifaddr *ifa)
 {
-	unsigned int hash = inet_addr_hash(net, ifa->ifa_address);
+	unsigned int hash = inet_addr_hash(net, ifa->ifa_local);
 
 	spin_lock(&inet_addr_hash_lock);
 	hlist_add_head_rcu(&ifa->hash, &inet_addr_lst[hash]);
@@ -146,7 +146,7 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)
 
 		if (!net_eq(dev_net(dev), net))
 			continue;
-		if (ifa->ifa_address == addr) {
+		if (ifa->ifa_local == addr) {
 			result = dev;
 			break;
 		}
-- 
1.7.4.1


Re: tun routing is broken

From: Jiri Slaby <hidden>
Date: 2011-03-05 08:17:30

On 03/05/2011 09:10 AM, David Miller wrote:
From: Jiri Slaby <redacted>
Date: Sat, 05 Mar 2011 09:04:22 +0100
quoted
Ok, so I booted the new kernel, and tun is broken there completely. If I
try to ping a vpn peer:
-mm tree is missing this fix which went in yesterday.  Please if
you are going to be testing networking a lot, test against net-next-2.6
instead of Andrew's tree which invariable lags behind:
I'm not testing networking, I'm just using my desktop :). (And
next/master is mostly unusable for these needs. In comparison to mmotm
which is some kind of a "release".)
--------------------
ipv4: Fix __ip_dev_find() to use ifa_local instead of ifa_address.
It would be great to have a References: tag or better changelog. Then I
would give the commit a shot. The way it is I ignored it when looking at
next/master inside net/ipv4/ changes for commits to test.

Going to boot with this change.
quoted hunk
Reported-by: Stephen Hemminger <redacted>
Reported-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv4/devinet.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 9038928..ff53860 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -111,7 +111,7 @@ static inline unsigned int inet_addr_hash(struct net *net, __be32 addr)
 
 static void inet_hash_insert(struct net *net, struct in_ifaddr *ifa)
 {
-	unsigned int hash = inet_addr_hash(net, ifa->ifa_address);
+	unsigned int hash = inet_addr_hash(net, ifa->ifa_local);
 
 	spin_lock(&inet_addr_hash_lock);
 	hlist_add_head_rcu(&ifa->hash, &inet_addr_lst[hash]);
@@ -146,7 +146,7 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)
 
 		if (!net_eq(dev_net(dev), net))
 			continue;
-		if (ifa->ifa_address == addr) {
+		if (ifa->ifa_local == addr) {
 			result = dev;
 			break;
 		}
thanks,
-- 
js
suse labs

Re: tun routing is broken

From: Jiri Slaby <hidden>
Date: 2011-03-05 08:26:35

On 03/05/2011 09:17 AM, Jiri Slaby wrote:
quoted
ipv4: Fix __ip_dev_find() to use ifa_local instead of ifa_address.
It would be great to have a References: tag or better changelog. Then I
would give the commit a shot. The way it is I ignored it when looking at
next/master inside net/ipv4/ changes for commits to test.

Going to boot with this change.
Yes, it works.

thanks,
-- 
js
suse labs

Re: tun routing is broken

From: Jiri Kosina <hidden>
Date: 2011-03-07 12:54:34

On Sat, 5 Mar 2011, Jiri Slaby wrote:
quoted
Date: Sat, 05 Mar 2011 09:04:22 +0100
quoted
Ok, so I booted the new kernel, and tun is broken there completely. If I
try to ping a vpn peer:
-mm tree is missing this fix which went in yesterday.  Please if
you are going to be testing networking a lot, test against net-next-2.6
instead of Andrew's tree which invariable lags behind:
I'm not testing networking, I'm just using my desktop :). (And
next/master is mostly unusable for these needs. In comparison to mmotm
which is some kind of a "release".)
I have been hit by similar issues several times already as well.

I guess that question of including -mm into linux-next should be raised 
again here ... Andrew, if I remember correctly, on last kernel summit you 
were stating that you'd stop eating untill you have -mm included in -next. 
Seems like you must be quite hungry these days already :)

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help