Received: with ECARTIS (v1.0.0; list linux-xfs); Mon, 21 Oct 2002 16:56:27 -0700 (PDT) Received: from pepsi.splentec.com (ns.splentec.com [209.47.35.194]) by oss.sgi.com (8.12.5/8.12.5) with SMTP id g9LNuOuR002792 for ; Mon, 21 Oct 2002 16:56:25 -0700 Received: from splentec.com (canoe.splentec.com [209.47.35.250]) by pepsi.splentec.com (8.11.6/8.11.0) with ESMTP id g9LNuKf13682; Mon, 21 Oct 2002 19:56:20 -0400 Message-ID: <3DB49424.9E4CAC0F@splentec.com> Date: Mon, 21 Oct 2002 19:56:20 -0400 From: Luben Tuikov Organization: Splentec Ltd. X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.19 i686) X-Accept-Language: en MIME-Version: 1.0 To: linux-xfs , Eric Sandeen Subject: PATCH: sleeping while holding a lock in _pagebuf_free_bh()::page_buf.c Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1149 X-ecartis-version: Ecartis v1.0.0 Sender: linux-xfs-bounce@oss.sgi.com Errors-to: linux-xfs-bounce@oss.sgi.com X-original-sender: luben@splentec.com Precedence: bulk X-list: linux-xfs Problem: on an SMP system, BANG#@!, the unthinkable happens. Solution: never sleep when holding a lock. This patch applies to CVS code as of about 18:30 EDT on Mon Oct 21 (today), and is self-explanatory. This patch fixes the problem of the mount going into D state indefinitely when the RAID is syncing and mount is run right after mkfs.xfs (from shell script, no sleep between, low system load, SMP). If you know of similar incidents in other parts of the code those should be fixed, probably ASAP. Please apply, -- Luben --- linux/fs/xfs/pagebuf/page_buf.c.orig Mon Oct 21 19:13:01 2002 +++ linux/fs/xfs/pagebuf/page_buf.c Mon Oct 21 19:13:05 2002 @@ -710,7 +710,7 @@ pb_resv_bh_cnt++; if (waitqueue_active(&pb_resv_bh_wait)) { - wake_up(&pb_resv_bh_wait); + wake_up_sync(&pb_resv_bh_wait); } }