2005-01-24 15:51:16

by Florian Lohoff

[permalink] [raw]
Subject: kernel BUG at fs/sysfs/symlink.c:87


Hi,
while using the bridging code between a tap0 and a real eth1 i got this:

Linux zmgr1.wstk.mediaways.net 2.6.10-zmgr-p3cel #1 Mon Jan 24 16:15:39 CET 2005 i686 GNU/Linux

UP, P3 Celeron, Non-Preempt, Vanilla Kernel

kernel BUG at fs/sysfs/symlink.c:87!
invalid operand: 0000 [#1]
Modules linked in: ppp_deflate bsd_comp ppp_async crc_ccitt ppp_generic slhc 3c59x bridge tun autofs eepro100 e100 mii i2c_i801 i2c_core uhci_hcd usbcore
CPU: 0
EIP: 0060:[<c017cac6>] Not tainted VLI
EFLAGS: 00010246 (2.6.10-zmgr-p3cel)
EIP is at sysfs_create_link+0x56/0x60
eax: c45ef738 ebx: 00000000 ecx: c709f000 edx: c39b3ec0
esi: c8880878 edi: c7915728 ebp: c79156a0 esp: c4d91e94
ds: 007b es: 007b ss: 0068
Process brctl (pid: 3500, threadinfo=c4d90000 task=c52b25e0)
Stack: c017b8cf c68ba7e4 c8880824 00000000 c887aa57 c45ef738 c7915728 c709f000
c45ef220 c709f000 c79156a0 c45ef220 00000000 c887762d c79156a0 c79156a0
c709f090 00000001 c709f000 c45ef220 ffffffed c4d91f34 c8877c34 c45ef220
Call Trace:
[<c017b8cf>] sysfs_create_file+0x2f/0x50
[<c887aa57>] br_sysfs_addif+0xe7/0x140 [bridge]
[<c887762d>] br_add_if+0xbd/0x160 [bridge]
[<c8877c34>] add_del_if+0x64/0x80 [bridge]
[<c022d564>] dev_ifsioc+0x384/0x3f0
[<c022d7b7>] dev_ioctl+0x1e7/0x260
[<c0269d2c>] inet_ioctl+0x9c/0xb0
[<c02231c9>] sock_ioctl+0xc9/0x240
[<c015bc79>] sys_ioctl+0xc9/0x240
[<c01024a3>] syscall_call+0x7/0xb
Code: 4c 24 04 8b 44 24 18 89 1c 24 89 44 24 08 e8 f2 fe ff ff 89 c1 8b 53 08 ff 42 68 0f 8e 0b 02 00 00 8b 5c 24 0c 89 c8 83 c4 10 c3 <0f> 0b 57 00 f5 59 2c c0 eb be 8b 44 24 04 8b 40 30 89 44 24 04
<7>tap0: no IPv6 routers present



Flo
--
Florian Lohoff [email protected] +49-171-2280134
Heisenberg may have been here.


Attachments:
(No filename) (1.76 kB)
(No filename) (189.00 B)
Download all attachments

2005-01-24 16:08:40

by Jörn Engel

[permalink] [raw]
Subject: Re: kernel BUG at fs/sysfs/symlink.c:87

On Mon, 24 January 2005 16:51:00 +0100, Florian Lohoff wrote:
>
> while using the bridging code between a tap0 and a real eth1 i got this:
>
> Linux zmgr1.wstk.mediaways.net 2.6.10-zmgr-p3cel #1 Mon Jan 24 16:15:39 CET 2005 i686 GNU/Linux
^^^^^^^^^^
Would be interesting to see if this shows up with a plain 2.6.10 as
well. Do you have time to check that?

Looks like br_sysfs_addif() forgot to add a dentry to the kobj passed
to sysfs_create_link(), but I'm not too familiar with that code.

> UP, P3 Celeron, Non-Preempt, Vanilla Kernel
>
> kernel BUG at fs/sysfs/symlink.c:87!
> invalid operand: 0000 [#1]
> Modules linked in: ppp_deflate bsd_comp ppp_async crc_ccitt ppp_generic slhc 3c59x bridge tun autofs eepro100 e100 mii i2c_i801 i2c_core uhci_hcd usbcore
> CPU: 0
> EIP: 0060:[<c017cac6>] Not tainted VLI
> EFLAGS: 00010246 (2.6.10-zmgr-p3cel)
> EIP is at sysfs_create_link+0x56/0x60
> eax: c45ef738 ebx: 00000000 ecx: c709f000 edx: c39b3ec0
> esi: c8880878 edi: c7915728 ebp: c79156a0 esp: c4d91e94
> ds: 007b es: 007b ss: 0068
> Process brctl (pid: 3500, threadinfo=c4d90000 task=c52b25e0)
> Stack: c017b8cf c68ba7e4 c8880824 00000000 c887aa57 c45ef738 c7915728 c709f000
> c45ef220 c709f000 c79156a0 c45ef220 00000000 c887762d c79156a0 c79156a0
> c709f090 00000001 c709f000 c45ef220 ffffffed c4d91f34 c8877c34 c45ef220
> Call Trace:
> [<c017b8cf>] sysfs_create_file+0x2f/0x50
> [<c887aa57>] br_sysfs_addif+0xe7/0x140 [bridge]
> [<c887762d>] br_add_if+0xbd/0x160 [bridge]
> [<c8877c34>] add_del_if+0x64/0x80 [bridge]
> [<c022d564>] dev_ifsioc+0x384/0x3f0
> [<c022d7b7>] dev_ioctl+0x1e7/0x260
> [<c0269d2c>] inet_ioctl+0x9c/0xb0
> [<c02231c9>] sock_ioctl+0xc9/0x240
> [<c015bc79>] sys_ioctl+0xc9/0x240
> [<c01024a3>] syscall_call+0x7/0xb
> Code: 4c 24 04 8b 44 24 18 89 1c 24 89 44 24 08 e8 f2 fe ff ff 89 c1 8b 53 08 ff 42 68 0f 8e 0b 02 00 00 8b 5c 24 0c 89 c8 83 c4 10 c3 <0f> 0b 57 00 f5 59 2c c0 eb be 8b 44 24 04 8b 40 30 89 44 24 04
> <7>tap0: no IPv6 routers present



J?rn

--
Good warriors cause others to come to them and do not go to others.
-- Sun Tzu

2005-01-24 16:29:05

by Florian Lohoff

[permalink] [raw]
Subject: Re: kernel BUG at fs/sysfs/symlink.c:87

On Mon, Jan 24, 2005 at 05:08:11PM +0100, J?rn Engel wrote:
> > Linux zmgr1.wstk.mediaways.net 2.6.10-zmgr-p3cel #1 Mon Jan 24 16:15:39 CET 2005 i686 GNU/Linux
> ^^^^^^^^^^
> Would be interesting to see if this shows up with a plain 2.6.10 as
> well. Do you have time to check that?

Debian - make-kpkg --append-to-version=-zmgr-p3cel

I am very shure this is vanilla - I compiled it myself just an hour ago.

> Looks like br_sysfs_addif() forgot to add a dentry to the kobj passed
> to sysfs_create_link(), but I'm not too familiar with that code.

Flo
--
Florian Lohoff [email protected] +49-171-2280134
Heisenberg may have been here.


Attachments:
(No filename) (730.00 B)
(No filename) (189.00 B)
Download all attachments

2005-01-24 19:57:47

by Florian Lohoff

[permalink] [raw]
Subject: Re: kernel BUG at fs/sysfs/symlink.c:87

On Mon, Jan 24, 2005 at 04:51:00PM +0100, Florian Lohoff wrote:
> Hi,
> while using the bridging code between a tap0 and a real eth1 i got this:
>
> Linux zmgr1.wstk.mediaways.net 2.6.10-zmgr-p3cel #1 Mon Jan 24 16:15:39 CET 2005 i686 GNU/Linux
>
> UP, P3 Celeron, Non-Preempt, Vanilla Kernel

brctl addbr br0
brctl addif br0 tap0
brctl addif br0 eth0
ifconfig br0 up

Oops

In this order it works

brctl addbr br0
ifconfig br0 up
brctl addif br0 tap0
brctl addif br0 eth0

Flo
--
Florian Lohoff [email protected] +49-171-2280134
Heisenberg may have been here.


Attachments:
(No filename) (614.00 B)
(No filename) (189.00 B)
Download all attachments

2005-01-25 11:35:56

by Jörn Engel

[permalink] [raw]
Subject: Re: kernel BUG at fs/sysfs/symlink.c:87

On Mon, 24 January 2005 18:04:45 +0100, Florian Lohoff wrote:
> On Mon, Jan 24, 2005 at 04:51:00PM +0100, Florian Lohoff wrote:
> > Hi,
> > while using the bridging code between a tap0 and a real eth1 i got this:
> >
> > Linux zmgr1.wstk.mediaways.net 2.6.10-zmgr-p3cel #1 Mon Jan 24 16:15:39 CET 2005 i686 GNU/Linux
> >
> > UP, P3 Celeron, Non-Preempt, Vanilla Kernel
>
> brctl addbr br0
> brctl addif br0 tap0
> brctl addif br0 eth0
> ifconfig br0 up
>
> Oops
>
> In this order it works
>
> brctl addbr br0
> ifconfig br0 up
> brctl addif br0 tap0
> brctl addif br0 eth0

Doesn't look too complicated, but I'm not familiar enough with the
bridge code. Setting Stephen on CC:, he should know a lot better.

J?rn

--
When you close your hand, you own nothing. When you open it up, you
own the whole world.
-- Li Mu Bai in Tiger & Dragon

2005-01-25 20:34:33

by Stephen Hemminger

[permalink] [raw]
Subject: Re: kernel BUG at fs/sysfs/symlink.c:87

I can't reproduce this with 2.6.11-rc2, could you try this patch to
see if it matters.

Puzzled, because the assert is.
BUG_ON(!kobj || !kobj->dentry || !name);
and call is

err = sysfs_create_link(&p->kobj, &br->dev->class_dev.kobj,
SYSFS_BRIDGE_PORT_LINK);
kobj can't be NULL, because &p->kobj can't be NULL
kobj->dentry is created by kobject_add
name is SYSFS_BRIDGE_PORT_LINK ("bridge")

The kobj->dentry should have been created by kobject_add()

kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR);
p->kobj.ktype = &brport_ktype;
p->kobj.parent = &(p->dev->class_dev.kobj);
p->kobj.kset = NULL;

err = kobject_add(&p->kobj);
and kobject_add does.
err = create_dir(kobj);
create_dir calls sysfs_create_dir(kobj).
===================

Since kobject_register initializes more fields, perhaps some part of kobject_add
got confused. Try this.

diff -Nru a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
--- a/net/bridge/br_sysfs_if.c 2005-01-25 12:28:00 -08:00
+++ b/net/bridge/br_sysfs_if.c 2005-01-25 12:28:00 -08:00
@@ -229,7 +229,7 @@
p->kobj.parent = &(p->dev->class_dev.kobj);
p->kobj.kset = NULL;

- err = kobject_add(&p->kobj);
+ err = kobject_register(&p->kobj);
if(err)
goto out1;