sysfs: remove "last sysfs file:" line from the oops messages
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 May 2011 23:01:02 +0000 (16:01 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 May 2011 23:05:51 +0000 (16:05 -0700)
On some arches (x86, sh, arm, unicore, powerpc) the oops message would
print out the last sysfs file accessed.

This was very useful in finding a number of sysfs and driver core bugs
in the 2.5 and early 2.6 development days, but it has been a number of
years since this file has actually helped in debugging anything that
couldn't also be trivially determined from the stack traceback.

So it's time to delete the line.  This is good as we need all the space
we can get for oops messages at times on consoles.

Acked-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/kernel/traps.c
arch/powerpc/kernel/traps.c
arch/sh/kernel/traps_32.c
arch/unicore32/kernel/traps.c
arch/x86/kernel/dumpstack.c
fs/sysfs/file.c
include/linux/sysfs.h

index 3b54ad19d4890c40752905af84a345b21ba56b62..d52eec268b4746a006ef3badf6805b8acae5d7e1 100644 (file)
@@ -234,7 +234,6 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
 
        printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
               str, err, ++die_counter);
-       sysfs_printk_last_file();
 
        /* trap and error numbers are mostly meaningless on ARM */
        ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV);
index 5ddb801bc15409ada686ee7fec56de73fac438cf..d782cd71c07ca57c1e0b7f4047ae125df6f8dac3 100644 (file)
@@ -143,7 +143,6 @@ int die(const char *str, struct pt_regs *regs, long err)
 #endif
                printk("%s\n", ppc_md.name ? ppc_md.name : "");
 
-               sysfs_printk_last_file();
                if (notify_die(DIE_OOPS, str, regs, err, 255,
                               SIGSEGV) == NOTIFY_STOP)
                        return 1;
index 3484c2f65aba32874f40738ee9b78c401354349c..b51a17104b5f8aba77312e4431d1f89677405463 100644 (file)
@@ -87,7 +87,6 @@ void die(const char * str, struct pt_regs * regs, long err)
        bust_spinlocks(1);
 
        printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
-       sysfs_printk_last_file();
        print_modules();
        show_regs(regs);
 
index 254e36fa951374343c35d7506dab696dc4bc3023..b9a26465e72822674a507e5583b4aa6f25914e2a 100644 (file)
@@ -192,7 +192,6 @@ static int __die(const char *str, int err, struct thread_info *thread,
 
        printk(KERN_EMERG "Internal error: %s: %x [#%d]\n",
               str, err, ++die_counter);
-       sysfs_printk_last_file();
 
        /* trap and error numbers are mostly meaningless on UniCore */
        ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, \
index e2a3f0606da4fa487d6d071ff0e964a16f44452c..f72e7193acc55c56f4e5b4c3e74e671faeae9fcc 100644 (file)
@@ -279,7 +279,6 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
        printk("DEBUG_PAGEALLOC");
 #endif
        printk("\n");
-       sysfs_printk_last_file();
        if (notify_die(DIE_OOPS, str, regs, err,
                        current->thread.trap_no, SIGSEGV) == NOTIFY_STOP)
                return 1;
index da3fefe91a8f855f59e62c84f0ef70a2a9bd0524..1ad8c93c1b8552d2cea0e461a2287c692f376cc9 100644 (file)
 
 #include "sysfs.h"
 
-/* used in crash dumps to help with debugging */
-static char last_sysfs_file[PATH_MAX];
-void sysfs_printk_last_file(void)
-{
-       printk(KERN_EMERG "last sysfs file: %s\n", last_sysfs_file);
-}
-
 /*
  * There's one sysfs_buffer for each open file and one
  * sysfs_open_dirent for each sysfs_dirent with one or more open
@@ -337,11 +330,6 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
        struct sysfs_buffer *buffer;
        const struct sysfs_ops *ops;
        int error = -EACCES;
-       char *p;
-
-       p = d_path(&file->f_path, last_sysfs_file, sizeof(last_sysfs_file));
-       if (!IS_ERR(p))
-               memmove(last_sysfs_file, p, strlen(p) + 1);
 
        /* need attr_sd for attr and ops, its parent for kobj */
        if (!sysfs_get_active(attr_sd))
index 30b881555fa576fc4a0fb9a82f8418fac72aefa2..c3acda60eee0819f9735e059b925ed739bf5831e 100644 (file)
@@ -176,7 +176,6 @@ struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
                                      const unsigned char *name);
 struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
 void sysfs_put(struct sysfs_dirent *sd);
-void sysfs_printk_last_file(void);
 
 /* Called to clear a ns tag when it is no longer valid */
 void sysfs_exit_ns(enum kobj_ns_type type, const void *tag);
@@ -348,10 +347,6 @@ static inline int __must_check sysfs_init(void)
        return 0;
 }
 
-static inline void sysfs_printk_last_file(void)
-{
-}
-
 #endif /* CONFIG_SYSFS */
 
 #endif /* _SYSFS_H_ */