[PATCH] remove the syslog interface when printk is disabled
authorMike Galbraith <efault@gmx.de>
Thu, 7 Dec 2006 04:37:42 +0000 (20:37 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Thu, 7 Dec 2006 16:39:38 +0000 (08:39 -0800)
Attempts to read() from the non-existent dmesg buffer will return zero and
userspace tends to get stuck in a busyloop.

So just remove /dev/kmsg altogether if CONFIG_PRINTK=n.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/proc/Makefile
fs/proc/proc_misc.c
kernel/printk.c

index 7431d7ba2d097981e1e87a191dc0ab81a2684537..f6c7762725727b49af2e7b4afbdff56a2440f822 100644 (file)
@@ -8,8 +8,9 @@ proc-y                  := nommu.o task_nommu.o
 proc-$(CONFIG_MMU)     := mmu.o task_mmu.o
 
 proc-y       += inode.o root.o base.o generic.o array.o \
-               kmsg.o proc_tty.o proc_misc.o
+               proc_tty.o proc_misc.o
 
 proc-$(CONFIG_PROC_KCORE)      += kcore.o
 proc-$(CONFIG_PROC_VMCORE)     += vmcore.o
 proc-$(CONFIG_PROC_DEVICETREE) += proc_devtree.o
+proc-$(CONFIG_PRINTK)  += kmsg.o
index 93c43b676e59f374813e9ae7095470ce9c23b87c..51815cece6f37cd92852d6b753049f12ce19bad6 100644 (file)
@@ -696,9 +696,11 @@ void __init proc_misc_init(void)
        proc_symlink("mounts", NULL, "self/mounts");
 
        /* And now for trickier ones */
+#ifdef CONFIG_PRINTK
        entry = create_proc_entry("kmsg", S_IRUSR, &proc_root);
        if (entry)
                entry->proc_fops = &proc_kmsg_operations;
+#endif
        create_seq_entry("devices", 0, &proc_devinfo_operations);
        create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations);
 #ifdef CONFIG_BLOCK
index 66426552fbfef24e49442ed08f8d595930feca32..ba59c2a30ed0ea38b41b9ef26133709a0af5181c 100644 (file)
@@ -631,12 +631,7 @@ EXPORT_SYMBOL(vprintk);
 
 asmlinkage long sys_syslog(int type, char __user *buf, int len)
 {
-       return 0;
-}
-
-int do_syslog(int type, char __user *buf, int len)
-{
-       return 0;
+       return -ENOSYS;
 }
 
 static void call_console_drivers(unsigned long start, unsigned long end)