]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/autofs/inode.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[mv-sheeva.git] / fs / autofs / inode.c
index 54c518c89e4cf86a8fec90124f21d7ca2e776169..aa0b61ff827078c8045d8a141a0d1a7a27fbdce0 100644 (file)
@@ -25,6 +25,15 @@ void autofs_kill_sb(struct super_block *sb)
        struct autofs_sb_info *sbi = autofs_sbi(sb);
        unsigned int n;
 
+       /*
+        * In the event of a failure in get_sb_nodev the superblock
+        * info is not present so nothing else has been setup, so
+        * just call kill_anon_super when we are called from
+        * deactivate_super.
+        */
+       if (!sbi)
+               goto out_kill_sb;
+
        if ( !sbi->catatonic )
                autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */
 
@@ -36,13 +45,14 @@ void autofs_kill_sb(struct super_block *sb)
 
        kfree(sb->s_fs_info);
 
+out_kill_sb:
        DPRINTK(("autofs: shutting down\n"));
        kill_anon_super(sb);
 }
 
 static void autofs_read_inode(struct inode *inode);
 
-static struct super_operations autofs_sops = {
+static const struct super_operations autofs_sops = {
        .read_inode     = autofs_read_inode,
        .statfs         = simple_statfs,
 };
@@ -136,7 +146,8 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 
        s->s_fs_info = sbi;
        sbi->magic = AUTOFS_SBI_MAGIC;
-       sbi->catatonic = 0;
+       sbi->pipe = NULL;
+       sbi->catatonic = 1;
        sbi->exp_timeout = 0;
        sbi->oz_pgrp = process_group(current);
        autofs_initialize_hash(&sbi->dirhash);
@@ -180,6 +191,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
        if ( !pipe->f_op || !pipe->f_op->write )
                goto fail_fput;
        sbi->pipe = pipe;
+       sbi->catatonic = 0;
 
        /*
         * Success! Install the root dentry now to indicate completion.
@@ -198,6 +210,7 @@ fail_iput:
        iput(root_inode);
 fail_free:
        kfree(sbi);
+       s->s_fs_info = NULL;
 fail_unlock:
        return -EINVAL;
 }