Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261309AbTIXMz6 (ORCPT ); Wed, 24 Sep 2003 08:55:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261346AbTIXMz6 (ORCPT ); Wed, 24 Sep 2003 08:55:58 -0400 Received: from mail-07.iinet.net.au ([203.59.3.39]:14300 "HELO mail.iinet.net.au") by vger.kernel.org with SMTP id S261309AbTIXMz4 (ORCPT ); Wed, 24 Sep 2003 08:55:56 -0400 Date: Wed, 24 Sep 2003 21:01:56 +0800 (WST) From: Ian Kent To: Kernel Mailing List cc: Maneesh Soni , autofs mailing list , Jeremy Fitzhardinge Subject: [PATCH] autofs4 deadlock during expire - kernel 2.6 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1751 Lines: 53 This is a corrected patch for the autofs4 daedlock problem I posted about yesterday. As before comments please. diff -Nur autofs4-2.6.orig/fs/autofs4/autofs_i.h autofs4-2.6.deadlock/fs/autofs4/autofs_i.h --- autofs4-2.6.orig/fs/autofs4/autofs_i.h 2003-09-09 03:50:14.000000000 +0800 +++ autofs4-2.6.deadlock/fs/autofs4/autofs_i.h 2003-09-22 22:48:11.000000000 +0800 @@ -82,6 +82,7 @@ char *name; /* This is for status reporting upon return */ int status; + struct task_struct *owner; int wait_ctr; }; diff -Nur autofs4-2.6.orig/fs/autofs4/waitq.c autofs4-2.6.deadlock/fs/autofs4/waitq.c --- autofs4-2.6.orig/fs/autofs4/waitq.c 2003-09-09 03:50:31.000000000 +0800 +++ autofs4-2.6.deadlock/fs/autofs4/waitq.c 2003-09-24 00:10:38.000000000 +0800 @@ -165,6 +165,7 @@ wq->status = -EINTR; /* Status return if interrupted */ memcpy(wq->name, name->name, name->len); wq->next = sbi->queues; + wq->owner = current; sbi->queues = wq; DPRINTK(("autofs_wait: new wait id = 0x%08lx, name = %.*s, nfy=%d\n", @@ -206,6 +207,11 @@ interruptible_sleep_on(&wq->queue); + if (waitqueue_active(&wq->queue) && current != wq->owner) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(wq->wait_ctr * (HZ/10)); + } + spin_lock_irqsave(¤t->sighand->siglock, irqflags); current->blocked = oldset; recalc_sigpending(); -- ,-._|\ Ian Kent / \ Perth, Western Australia *_.--._/ E-mail: raven@themaw.net v Web: http://themaw.net/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/