2004-03-01 19:48:36

by Nigel Kukard

[permalink] [raw]
Subject: [2.6.3] Sysfs breakage - tun.ko

Hi,

Loading tun.ko module breaks on sysfs...

> [root@localhost misc]# pwd
> /sys/class/misc
> [root@localhost misc]# ls
> dac960_gam device-mapper net/tun psaux
> [root@localhost misc]# cd net\/tun
> bash: cd: net/tun: No such file or directory
> [root@localhost misc]#


Why not just make it in misc? why net/tun seeing as everything else is
just dumped there. Patch below.



--- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
+++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
@@ -605,7 +605,7 @@

static struct miscdevice tun_miscdev = {
.minor = TUN_MINOR,
- .name = "net/tun",
+ .name = "tun",
.fops = &tun_fops
};


2004-03-01 20:20:35

by Kevin P. Fleming

[permalink] [raw]
Subject: Re: [2.6.3] Sysfs breakage - tun.ko

Nigel Kukard wrote:

> --- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> +++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> @@ -605,7 +605,7 @@
>
> static struct miscdevice tun_miscdev = {
> .minor = TUN_MINOR,
> - .name = "net/tun",
> + .name = "tun",
> .fops = &tun_fops
> };

This changed back and forth since the tun driver was added to the
kernel; making this change will cause the devfs path to the tun node to
change, and userspace applications expect it to be at /dev/misc/net/tun,
whether that's right or wrong.

2004-03-01 20:27:37

by Nigel Kukard

[permalink] [raw]
Subject: Re: [2.6.3] Sysfs breakage - tun.ko

Nevermind if its right or wrong, it does not work in sysfs

-Nigel

On Mon, Mar 01, 2004 at 01:20:19PM -0700, Kevin P. Fleming wrote:
> Nigel Kukard wrote:
>
> >--- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> >+++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> >@@ -605,7 +605,7 @@
> >
> > static struct miscdevice tun_miscdev = {
> > .minor = TUN_MINOR,
> >- .name = "net/tun",
> >+ .name = "tun",
> > .fops = &tun_fops
> > };
>
> This changed back and forth since the tun driver was added to the
> kernel; making this change will cause the devfs path to the tun node to
> change, and userspace applications expect it to be at /dev/misc/net/tun,
> whether that's right or wrong.

2004-03-01 20:47:28

by Chris Wright

[permalink] [raw]
Subject: Re: [2.6.3] Sysfs breakage - tun.ko

* Kevin P. Fleming ([email protected]) wrote:
> Nigel Kukard wrote:
>
> > --- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> > +++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> > @@ -605,7 +605,7 @@
> >
> > static struct miscdevice tun_miscdev = {
> > .minor = TUN_MINOR,
> > - .name = "net/tun",
> > + .name = "tun",
> > .fops = &tun_fops
> > };
>
> This changed back and forth since the tun driver was added to the
> kernel; making this change will cause the devfs path to the tun node to
> change, and userspace applications expect it to be at /dev/misc/net/tun,
> whether that's right or wrong.

Why don't you use:
.devfs_name = "net/tun",

Or fix userspace apps? Or switch to udev with devfs rules emulated and a
rule for the tun/tap driver?

thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net

2004-03-01 21:08:12

by Kevin P. Fleming

[permalink] [raw]
Subject: Re: [2.6.3] Sysfs breakage - tun.ko

Chris Wright wrote:

> Why don't you use:
> .devfs_name = "net/tun",

That seems fine, if it will do the job.

> Or fix userspace apps? Or switch to udev with devfs rules emulated and a
> rule for the tun/tap driver?

This is a stable kernel series; these kinds of userspace-breakage
changes are not supposed to happen. Personally I have already started
migrating my systems to udev, but it will take some time to complete
that. Regardless, this would be a userspace-incompatible change if using
.devfs_name won't do the job.

2004-03-02 00:33:10

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [2.6.3] Sysfs breakage - tun.ko

Followup to: <[email protected]>
By author: "Kevin P. Fleming" <[email protected]>
In newsgroup: linux.dev.kernel
>
> Nigel Kukard wrote:
>
> > --- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> > +++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> > @@ -605,7 +605,7 @@
> >
> > static struct miscdevice tun_miscdev = {
> > .minor = TUN_MINOR,
> > - .name = "net/tun",
> > + .name = "tun",
> > .fops = &tun_fops
> > };
>
> This changed back and forth since the tun driver was added to the
> kernel; making this change will cause the devfs path to the tun node to
> change, and userspace applications expect it to be at /dev/misc/net/tun,
> whether that's right or wrong.
>

Bullsh*t.

User-space apps expect it to be /dev/net/tun, which is the documented
path for this device node. Anything else is a devfs bug (/dev/misc is
a devfs bug from beginning to end.)

-hpa

2004-03-02 06:03:34

by Nigel Kukard

[permalink] [raw]
Subject: Re: [2.6.3] Sysfs breakage - tun.ko


Nothing said solves the problem, the problem has got nothing to do with
devfs (only for compat reasons), the problem is that "net/tun" breaks
sysfs.

-Nigel


On Mon, Mar 01, 2004 at 01:20:19PM -0700, Kevin P. Fleming wrote:
> Nigel Kukard wrote:
>
> >--- drivers/net/tun.c.old 2004-02-27 18:18:55.000000000 +0200
> >+++ drivers/net/tun.c 2004-02-27 18:19:02.000000000 +0200
> >@@ -605,7 +605,7 @@
> >
> > static struct miscdevice tun_miscdev = {
> > .minor = TUN_MINOR,
> >- .name = "net/tun",
> >+ .name = "tun",
> > .fops = &tun_fops
> > };
>
> This changed back and forth since the tun driver was added to the
> kernel; making this change will cause the devfs path to the tun node to
> change, and userspace applications expect it to be at /dev/misc/net/tun,
> whether that's right or wrong.


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

2004-03-03 02:28:42

by Chris Wright

[permalink] [raw]
Subject: Re: [2.6.3] Sysfs breakage - tun.ko

* Nigel Kukard ([email protected]) wrote:
>
> Nothing said solves the problem, the problem has got nothing to do with
> devfs (only for compat reasons), the problem is that "net/tun" breaks
> sysfs.

Yes, why does this not work? Keeps devfs legacy name, works fine with
udev, and makes proper dir in sysfs.

thanks,
-chris

===== drivers/net/tun.c 1.29 vs edited =====
--- 1.29/drivers/net/tun.c Sat Jan 10 16:09:09 2004
+++ edited/drivers/net/tun.c Tue Mar 2 12:05:30 2004
@@ -602,7 +602,8 @@

static struct miscdevice tun_miscdev = {
.minor = TUN_MINOR,
- .name = "net/tun",
+ .name = "tun",
+ .devfs_name = "net/tun",
.fops = &tun_fops
};

2004-03-04 05:26:28

by Nigel Kukard

[permalink] [raw]
Subject: Re: [2.6.3] Sysfs breakage - tun.ko

Thanks bud!

Hopefully it'll get included in 2.6.4 ;)

On Tue, Mar 02, 2004 at 06:28:34PM -0800, Chris Wright wrote:
> * Nigel Kukard ([email protected]) wrote:
> >
> > Nothing said solves the problem, the problem has got nothing to do with
> > devfs (only for compat reasons), the problem is that "net/tun" breaks
> > sysfs.
>
> Yes, why does this not work? Keeps devfs legacy name, works fine with
> udev, and makes proper dir in sysfs.
>
> thanks,
> -chris
>
> ===== drivers/net/tun.c 1.29 vs edited =====
> --- 1.29/drivers/net/tun.c Sat Jan 10 16:09:09 2004
> +++ edited/drivers/net/tun.c Tue Mar 2 12:05:30 2004
> @@ -602,7 +602,8 @@
>
> static struct miscdevice tun_miscdev = {
> .minor = TUN_MINOR,
> - .name = "net/tun",
> + .name = "tun",
> + .devfs_name = "net/tun",
> .fops = &tun_fops
> };
>


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