commit c51d3bbd2c2256e2567984068bc0950b4ac73e49
Author: Thomas Gleixner <[EMAIL PROTECTED]>
Date:   Sun Feb 24 02:10:06 2008 +0000

    futex: fix init order
    
    commit: 3e4ab747efa8e78562ec6782b08bbf21a00aba1b
    
    When the futex init code fails to initialize the futex pseudo file system it
    returns early without initializing the hash queues.  Should the boot succeed
    then a futex syscall which tries to enqueue a waiter on the hashqueue will
    crash due to the unitilialized plist heads.
    
    Initialize the hash queues before the filesystem.
    
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Lennert Buytenhek <[EMAIL PROTECTED]>
    Cc: Riku Voipio <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
    Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

diff --git a/kernel/futex.c b/kernel/futex.c
index 55d78b5..176cddb 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2123,8 +2123,14 @@ static struct file_system_type futex_fs_type = {
 
 static int __init init(void)
 {
-       int i = register_filesystem(&futex_fs_type);
+       int i;
 
+       for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
+               plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
+               spin_lock_init(&futex_queues[i].lock);
+       }
+
+       i = register_filesystem(&futex_fs_type);
        if (i)
                return i;
 
@@ -2134,10 +2140,6 @@ static int __init init(void)
                return PTR_ERR(futex_mnt);
        }
 
-       for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
-               plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
-               spin_lock_init(&futex_queues[i].lock);
-       }
        return 0;
 }
 __initcall(init);
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to