summaryrefslogtreecommitdiff
path: root/fs/char_dev.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2010-08-06 16:34:43 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 09:17:02 -0700
commit31d1d48e199e99077fb30f6fb9a793be7bec756f (patch)
tree7f9dddbd89030765f6544e5820c401849193dca8 /fs/char_dev.c
parent1e456a124353a753e9d1fadfbf5cd459c2f197ae (diff)
Fix init ordering of /dev/console vs callers of modprobe
Make /dev/console get initialised before any initialisation routine that invokes modprobe because if modprobe fails, it's going to want to open /dev/console, presumably to write an error message to. The problem with that is that if the /dev/console driver is not yet initialised, the chardev handler will call request_module() to invoke modprobe, which will fail, because we never compile /dev/console as a module. This will lead to a modprobe loop, showing the following in the kernel log: request_module: runaway loop modprobe char-major-5-1 request_module: runaway loop modprobe char-major-5-1 request_module: runaway loop modprobe char-major-5-1 request_module: runaway loop modprobe char-major-5-1 request_module: runaway loop modprobe char-major-5-1 This can happen, for example, when the built in md5 module can't find the built in cryptomgr module (because the latter fails to initialise). The md5 module comes before the call to tty_init(), presumably because 'crypto' comes before 'drivers' alphabetically. Fix this by calling tty_init() from chrdev_init(). Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/char_dev.c')
-rw-r--r--fs/char_dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c
index d6db933df2b2..f80a4f25123c 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -20,6 +20,7 @@
#include <linux/cdev.h>
#include <linux/mutex.h>
#include <linux/backing-dev.h>
+#include <linux/tty.h>
#include "internal.h"