devfs breakage in 2.4.0 release
Noticed following devfs related problems with kernel version 2.4.0 on one Pentium 200MMX box (the same problem with 2.4.0-ac2, but earlier 2.4.0-test10 doesn't have this problem)
I was able to reproduce it reliably by following steps:
- booted machine in runlevel 3
- logged in as user and started MC (on first console)
- logged out
- logged in as different user (in this case root) and tried to start MC again
This time it hangs. The source of problem appears to be devfs related as devfsd exited with error message that it cannot state vcc/1 as there is no such file or directory. Related parts of log files (boot parameter devfs=dall) and other related information (I hope...) is in attachment. Of course MC is not behaving nicely, but the primary source of problem seems to be devfs
On this machine kernel was compiled for Pentium CPUs. I tried to reproduce the same on a different machine with Pentium III 700 using kernel 2.4.0. It took more relogging as on Pentium 200, but I got the same problem once (on slower machine I was able to reproduce it more reliably).
Andris
Quoted 11 lines · Andris Pavenis
Noticed following devfs related problems with kernel version 2.4.0 on one Pentium 200MMX box (the same problem with 2.4.0-ac2, but earlier 2.4.0-test10 doesn't have this problem)
I was able to reproduce it reliably by following steps:
- booted machine in runlevel 3
- logged in as user and started MC (on first console)
- logged out
- logged in as different user (in this case root) and tried to start MC again
Quoted 6 lines
This time it hangs. The source of problem appears to be devfs related as devfsd exited with error message that it cannot state vcc/1 as there is no such file or directory. Related parts of log files (boot parameter devfs=dall) and other related information (I hope...) is in attachment. Of course MC is not behaving nicely, but the primary source of problem seems to be devfs
As I tested devfsd dies after I'm logging out (very often on P200MMX, much more seldom on P3 700). I suspect some devfs related race
Quoted 5 lines
On this machine kernel was compiled for Pentium CPUs. I tried to reproduce the same on a different machine with Pentium III 700 using kernel 2.4.0. It took more relogging as on Pentium 200, but I got the same problem once (on slower machine I was able to reproduce it more reliably).
I tries 2.4.1-pre3 and got the same. Modifying devfsd.c to retry stating some times before giving up workarounds the problem (As far as I tested I'm getting only one retry ...)
Perhaps it's kernel's bug anyway, but I think it's doesn't harm to make devfsd slightly more errorproof. I'm including patch for devfsd (I had also to define __USE_GNU to get devfsd compile with glibc-2.2 at all ...)
Of course best solution would be to fix the race itself (it appeared sometimes between 2.4.0-test10 and 2.4.0-test12, first one is OK) ....
Andris
devfsd.c renamed from devfsd.c~1 +19 -4
@@ -189,6 +189,7 @@#include <signal.h> #include <regex.h> #include <errno.h> +#define __USE_GNU#include <dlfcn.h> #include <rpcsvc/ypclnt.h> #include <rpcsvc/yp_prot.h>
@@ -918,15 +919,29 @@[RETURNS] Nothing. */ { +int tries=0 ;mode_t new_mode;struct stat statbuf; +Retry:if (lstat (info->devname, &statbuf) !=0 ) { -SYSLOG (LOG_ERR ,"error stat(2)ing: \"%s\"\t%s\n" , - info->devname,ERRSTRING ); -SYSLOG (LOG_ERR ,"exiting\n" ); -exit (1 ); +if (tries<10 ) + { + tries++; +SYSLOG (LOG_ERR ,"error stat(2)ing: \"%s\"\t%s\n" , + info->devname,ERRSTRING ); +SYSLOG (LOG_ERR ,"retrying (attempt %d) ...\n" ,tries); +usleep (1000 );/* Let's sleep a bit */ + goto Retry; + } +else + { +SYSLOG (LOG_ERR ,"error stat(2)ing: \"%s\"\t%s\n" , + info->devname,ERRSTRING ); +SYSLOG (LOG_ERR ,"exiting\n" ); +exit (1 ); + } } new_mode = (statbuf.st_mode &S_IFMT ) | (entry->u.permissions.mode & ~S_IFMT );
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
Quoted 32 lines · Andris Pavenis
Quoted 11 lines · Andris Pavenis
Noticed following devfs related problems with kernel version 2.4.0 on one Pentium 200MMX box (the same problem with 2.4.0-ac2, but earlier 2.4.0-test10 doesn't have this problem)
I was able to reproduce it reliably by following steps:
- booted machine in runlevel 3
- logged in as user and started MC (on first console)
- logged out
- logged in as different user (in this case root) and tried to start MC againQuoted 6 lines
This time it hangs. The source of problem appears to be devfs related as devfsd exited with error message that it cannot state vcc/1 as there is no such file or directory. Related parts of log files (boot parameter devfs=dall) and other related information (I hope...) is in attachment. Of course MC is not behaving nicely, but the primary source of problem seems to be devfs
As I tested devfsd dies after I'm logging out (very often on P200MMX, much more seldom on P3 700). I suspect some devfs related race
Quoted 5 lines
On this machine kernel was compiled for Pentium CPUs. I tried to reproduce the same on a different machine with Pentium III 700 using kernel 2.4.0. It took more relogging as on Pentium 200, but I got the same problem once (on slower machine I was able to reproduce it more reliably).
I tries 2.4.1-pre3 and got the same. Modifying
devfsd.cto retry stating some times before giving up workarounds the problem (As far as I tested I'm getting only one retry ...)
Quoted 7 lines
Perhaps it's kernel's bug anyway, but I think it's doesn't harm to make devfsd slightly more errorproof. I'm including patch for devfsd (I had also to define
__USE_GNUto get devfsd compile with glibc-2.2 at all ...)Of course best solution would be to fix the race itself (it appeared sometimes between 2.4.0-test10 and 2.4.0-test12, first one is OK) ....
I spent some time building various kernels on P200MMX box I have this problem to happen more often. It looks that problem appears in 2.4.0-test12-pre8 but is not present in 2.4.0-test12-pre7
Andris
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
Problems with devfs [WAS: Re: devfs breakage in 2.4.0 release]
In reply to Andris PavenisQuoted 37 lines · Andris Pavenis
Quoted 36 lines · Andris Pavenis
Quoted 11 lines · Andris Pavenis
Noticed following devfs related problems with kernel version 2.4.0 on one Pentium 200MMX box (the same problem with 2.4.0-ac2, but earlier 2.4.0-test10 doesn't have this problem)
I was able to reproduce it reliably by following steps:
- booted machine in runlevel 3
- logged in as user and started MC (on first console)
- logged out
- logged in as different user (in this case root) and tried to start MC againQuoted 6 lines
This time it hangs. The source of problem appears to be devfs related as devfsd exited with error message that it cannot state vcc/1 as there is no such file or directory. Related parts of log files (boot parameter devfs=dall) and other related information (I hope...) is in attachment. Of course MC is not behaving nicely, but the primary source of problem seems to be devfs
As I tested devfsd dies after I'm logging out (very often on P200MMX, much more seldom on P3 700). I suspect some devfs related race
Quoted 5 lines
On this machine kernel was compiled for Pentium CPUs. I tried to reproduce the same on a different machine with Pentium III 700 using kernel 2.4.0. It took more relogging as on Pentium 200, but I got the same problem once (on slower machine I was able to reproduce it more reliably).
I tries 2.4.1-pre3 and got the same. Modifying
devfsd.cto retry stating some times before giving up workarounds the problem (As far as I tested I'm getting only one retry ...)Perhaps it's kernel's bug anyway, but I think it's doesn't harm to make devfsd slightly more errorproof. I'm including patch for devfsd (I had also to define
__USE_GNUto get devfsd compile with glibc-2.2 at all ...)
Quoted 7 lines
Quoted 2 lines
Of course best solution would be to fix the race itself (it appeared sometimes between 2.4.0-test10 and 2.4.0-test12, first one is OK) ....
I spent some time building various kernels on P200MMX box I have this problem to happen more often. It looks that problem appears in 2.4.0-test12-pre8 but is not present in 2.4.0-test12-pre7
Forgot to mention: I have line
REGISTER vcc/a* PERMISSIONS root.vcsa rw-rw----
REGISTER vcc/[0-9] PERMISSIONS root.tty rw-rw----
in /etc/devfsd.conf (to change permissions for vcc/* as I don't want to make some applications suid root)
So perhaps after logout current of vcc/[0-9] is reregistered, but sometimes devfsd suceeds to try to change permissions before the new node is created and stat() fails (ENOENT) in action_permissions(), as result unpached devfsd-1.3.11 exits with error message. Adding code to retry stat() after some small delay (usleep(1000)) workarounds problem.
I'm including full /etc.devfsd in attachment.
Andris
# Sample /etc/devfsd.conf configuration file.
# Richard Gooch <[email protected]> 3-FEB-2000
#
# Enable full compatibility mode for old device names. You may comment these
# out if you don't use the old device names. Make sure you know what you're # doing! REGISTER .* MKOLDCOMPAT UNREGISTER .* RMOLDCOMPAT
# You may comment out the above and uncomment the following if you've
# configured your system to use the original "new" devfs names or the really # new names #REGISTER vc/.* MKOLDCOMPAT #UNREGISTER vc/.* RMOLDCOMPAT #REGISTER pty/.* MKOLDCOMPAT #UNREGISTER pty/.* RMOLDCOMPAT #REGISTER misc MKOLDCOMPAT #UNREGISTER misc RMOLDCOMPAT
# Enable module autoloading. You may comment this out if you don't use
# autoloading LOOKUP .* MODLOAD
# You may comment these out if you don't use the original "new" names
REGISTER .* MKNEWCOMPAT
UNREGISTER .* RMNEWCOMPAT
#
#
REGISTER floppy/* PERMISSIONS root.floppy rw-rw----
REGISTER sound/audio PERMISSIONS root.sound rw-rw----
REGISTER sound/dsp PERMISSIONS root.sound rw-rw----
REGISTER sound/dspW PERMISSIONS root.sound rw-rw----
REGISTER sound/mixer PERMISSIONS root.sound rw-rw----
REGISTER misc/psaux EXECUTE /bin/ln -s /dev/misc/psaux /dev/mouse
REGISTER vcc/a* PERMISSIONS root.vcsa rw-rw----
REGISTER vcc/[0-9] PERMISSIONS root.tty rw-rw----
REGISTER ide/host0/bus1/target0/lun0/cd EXECUTE /bin/ln -s /dev/ide/host0/bus1/target0/lun0/cd /dev/cdrom