Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40905
b: refs/heads/master
c: ba8df43
h: refs/heads/master
i:
  40903: 427d55c
v: v3
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Nov 14, 2006
1 parent 99ef371 commit b7ea1ad
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a34b57bec41c95f1e38f700cd9b81324baaffc7
refs/heads/master: ba8df43c0ee93ec05fc526278a80aaf4cb5ab1fa
14 changes: 13 additions & 1 deletion trunk/fs/autofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ 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 exit when we are called from deactivate_super.
*/
if (!sbi)
return;

if ( !sbi->catatonic )
autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */

Expand Down Expand Up @@ -136,7 +144,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);
Expand Down Expand Up @@ -180,6 +189,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.
Expand All @@ -198,6 +208,8 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
iput(root_inode);
fail_free:
kfree(sbi);
s->s_fs_info = NULL;
kill_anon_super(s);
fail_unlock:
return -EINVAL;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/autofs/waitq.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void autofs_catatonic_mode(struct autofs_sb_info *sbi)
wq = nwq;
}
fput(sbi->pipe); /* Close the pipe */
sbi->pipe = NULL;
autofs_hash_dputall(&sbi->dirhash); /* Remove all dentry pointers */
}

Expand Down
17 changes: 16 additions & 1 deletion trunk/fs/autofs4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ static void autofs4_force_release(struct autofs_sb_info *sbi)
struct dentry *this_parent = sbi->sb->s_root;
struct list_head *next;

if (!sbi->sb->s_root)
return;

spin_lock(&dcache_lock);
repeat:
next = this_parent->d_subdirs.next;
Expand Down Expand Up @@ -146,6 +149,14 @@ void autofs4_kill_sb(struct super_block *sb)
{
struct autofs_sb_info *sbi = autofs4_sbi(sb);

/*
* In the event of a failure in get_sb_nodev the superblock
* info is not present so nothing else has been setup, so
* just exit when we are called from deactivate_super.
*/
if (!sbi)
return;

sb->s_fs_info = NULL;

if ( !sbi->catatonic )
Expand Down Expand Up @@ -310,7 +321,8 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
s->s_fs_info = sbi;
sbi->magic = AUTOFS_SBI_MAGIC;
sbi->pipefd = -1;
sbi->catatonic = 0;
sbi->pipe = NULL;
sbi->catatonic = 1;
sbi->exp_timeout = 0;
sbi->oz_pgrp = process_group(current);
sbi->sb = s;
Expand Down Expand Up @@ -388,6 +400,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
goto fail_fput;
sbi->pipe = pipe;
sbi->pipefd = pipefd;
sbi->catatonic = 0;

/*
* Success! Install the root dentry now to indicate completion.
Expand All @@ -412,6 +425,8 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
kfree(ino);
fail_free:
kfree(sbi);
s->s_fs_info = NULL;
kill_anon_super(s);
fail_unlock:
return -EINVAL;
}
Expand Down
6 changes: 2 additions & 4 deletions trunk/fs/autofs4/waitq.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ void autofs4_catatonic_mode(struct autofs_sb_info *sbi)
wake_up_interruptible(&wq->queue);
wq = nwq;
}
if (sbi->pipe) {
fput(sbi->pipe); /* Close the pipe */
sbi->pipe = NULL;
}
fput(sbi->pipe); /* Close the pipe */
sbi->pipe = NULL;
}

static int autofs4_write(struct file *file, const void *addr, int bytes)
Expand Down

0 comments on commit b7ea1ad

Please sign in to comment.