Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=78ae87c3cd723c8a8dcd67d4e4cbc6d63671c108
Commit:     78ae87c3cd723c8a8dcd67d4e4cbc6d63671c108
Parent:     4c738480d21a190e3d99c7ce985ab9484f373a3c
Author:     Andrew Morton <[EMAIL PROTECTED]>
AuthorDate: Sun Jun 3 13:50:41 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Jun 4 13:25:10 2007 -0700

    vanishing ioctl handler debugging
    
    We've had several reoprts of the CPU jumping to 0x00000000 is do_ioctl().  I
    assume that there's a race and someone is zeroing out the ioctl handler 
while
    this CPU waits for the lock_kernel().
    
    The patch adds code to detect this, then emits stuff which will hopefuly 
lead
    us to the culprit.
    
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/ioctl.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/fs/ioctl.c b/fs/ioctl.c
index 479c103..8c90cbc 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -12,6 +12,7 @@
 #include <linux/fs.h>
 #include <linux/security.h>
 #include <linux/module.h>
+#include <linux/kallsyms.h>
 
 #include <asm/uaccess.h>
 #include <asm/ioctls.h>
@@ -20,6 +21,7 @@ static long do_ioctl(struct file *filp, unsigned int cmd,
                unsigned long arg)
 {
        int error = -ENOTTY;
+       void *f;
 
        if (!filp->f_op)
                goto out;
@@ -29,10 +31,16 @@ static long do_ioctl(struct file *filp, unsigned int cmd,
                if (error == -ENOIOCTLCMD)
                        error = -EINVAL;
                goto out;
-       } else if (filp->f_op->ioctl) {
+       } else if ((f = filp->f_op->ioctl)) {
                lock_kernel();
-               error = filp->f_op->ioctl(filp->f_path.dentry->d_inode,
-                                         filp, cmd, arg);
+               if (!filp->f_op->ioctl) {
+                       printk("%s: ioctl %p disappeared\n", __FUNCTION__, f);
+                       print_symbol("symbol: %s\n", (unsigned long)f);
+                       dump_stack();
+               } else {
+                       error = filp->f_op->ioctl(filp->f_path.dentry->d_inode,
+                                                 filp, cmd, arg);
+               }
                unlock_kernel();
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to