summaryrefslogtreecommitdiffstats
path: root/fs/autofs/waitq.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
commit86464aed71025541805e7b1515541aee89879e33 (patch)
treee01a457a4912a8553bc65524aa3125d51f29f810 /fs/autofs/waitq.c
parent88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff)
Merge with Linux 2.2.1.
Diffstat (limited to 'fs/autofs/waitq.c')
-rw-r--r--fs/autofs/waitq.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c
index 0a36930d9..81c68af46 100644
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -41,6 +41,7 @@ void autofs_catatonic_mode(struct autofs_sb_info *sbi)
wq = nwq;
}
fput(sbi->pipe); /* Close the pipe */
+ autofs_hash_dputall(&sbi->dirhash); /* Remove all dentry pointers */
}
static int autofs_write(struct file *file, const void *addr, int bytes)
@@ -103,6 +104,10 @@ int autofs_wait(struct autofs_sb_info *sbi, struct qstr * name)
struct autofs_wait_queue *wq;
int status;
+ /* In catatonic mode, we don't wait for nobody */
+ if ( sbi->catatonic )
+ return -ENOENT;
+
for ( wq = sbi->queues ; wq ; wq = wq->next ) {
if ( wq->hash == name->hash &&
wq->len == name->len &&
@@ -138,6 +143,15 @@ int autofs_wait(struct autofs_sb_info *sbi, struct qstr * name)
/* wq->name is NULL if and only if the lock is already released */
+ if ( sbi->catatonic ) {
+ /* We might have slept, so check again for catatonic mode */
+ wq->status = -ENOENT;
+ if ( wq->name ) {
+ kfree(wq->name);
+ wq->name = NULL;
+ }
+ }
+
if ( wq->name ) {
/* Block all but "shutdown" signals while waiting */
sigset_t oldset;