patch-2.2.0-pre1 linux/fs/autofs/waitq.c

Next file: linux/fs/binfmt_misc.c
Previous file: linux/fs/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.132/linux/fs/autofs/waitq.c linux/fs/autofs/waitq.c
@@ -103,6 +103,10 @@
 	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 &&
@@ -137,6 +141,15 @@
 		wq->wait_ctr++;
 
 	/* 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 */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov