From owner-freebsd-fs@FreeBSD.ORG Tue Feb 1 18:53:01 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24CD8106564A; Tue, 1 Feb 2011 18:53:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EB84D8FC14; Tue, 1 Feb 2011 18:53:00 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A666946B06; Tue, 1 Feb 2011 13:53:00 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A8DA98A027; Tue, 1 Feb 2011 13:52:59 -0500 (EST) From: John Baldwin To: Doug Barton Date: Tue, 1 Feb 2011 13:52:57 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <4D47B954.3010600@FreeBSD.org> In-Reply-To: <4D47B954.3010600@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102011352.57998.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 01 Feb 2011 13:52:59 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: freebsd-fs@freebsd.org Subject: Re: ext2fs crash in -current (r218056) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2011 18:53:01 -0000 On Tuesday, February 01, 2011 2:42:12 am Doug Barton wrote: > As I've discussed here previously I am using ext2fs in -current as a > general-purpose /home directory, which includes my ports tree, and at > the time of the crash my WRKDIRPREFIX. I was doing some heavy ports > building to re-create my amd64-current system from scratch when the > following crash happened (sorry for the fuzzy photo): > > http://dougbarton.us/ext2fs-crash-dump.jpg > http://dougbarton.us/ext2fs-crash-dump.txt > > Previous to the recent changes in -current I hadn't been experiencing > actual crashes, so I can't help think this is related to some of the > changes that John has been shepherding in recently. Please try this: Index: ext2_alloc.c =================================================================== --- ext2_alloc.c (revision 218175) +++ ext2_alloc.c (working copy) @@ -650,6 +650,18 @@ EXT2_LOCK(ump); return (0); } + EXT2_LOCK(ump); + if (fs->e2fs_gd[cg].ext2bgd_nbfree == 0) { + /* + * Another thread allocated the last block in this + * group while we were waiting for the buffer. + */ + EXT2_UNLOCK(ump); + brelse(bp); + EXT2_LOCK(ump); + return (0); + } + EXT2_UNLOCK(ump); bbp = (char *)bp->b_data; if (dtog(fs, bpref) != cg) @@ -776,6 +788,18 @@ EXT2_LOCK(ump); return (0); } + EXT2_LOCK(ump); + if (fs->e2fs_gd[cg].ext2bgd_nifree == 0) { + /* + * Another thread allocated the last i-node in this + * group while we were waiting for the buffer. + */ + EXT2_UNLOCK(ump); + brelse(bp); + EXT2_LOCK(ump); + return (0); + } + EXT2_UNLOCK(ump); ibp = (char *)bp->b_data; if (ipref) { ipref %= fs->e2fs->e2fs_ipg; -- John Baldwin