From owner-freebsd-stable@FreeBSD.ORG Wed Nov 12 19:49:42 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DE4510656AD; Wed, 12 Nov 2008 19:49:42 +0000 (UTC) (envelope-from tdb@carrick.bishnet.net) Received: from carrick.bishnet.net (carrick.bishnet.net [IPv6:2a01:348:132::1]) by mx1.freebsd.org (Postfix) with ESMTP id B1A7E8FC1C; Wed, 12 Nov 2008 19:49:40 +0000 (UTC) (envelope-from tdb@carrick.bishnet.net) Received: from tdb by carrick.bishnet.net with local (Exim 4.66 (FreeBSD)) (envelope-from ) id 1L0LiS-00059u-R2; Wed, 12 Nov 2008 19:49:28 +0000 Date: Wed, 12 Nov 2008 19:49:28 +0000 From: Tim Bishop To: freebsd-stable@freebsd.org Message-ID: <20081112194928.GA19539@carrick.bishnet.net> References: <20081112175826.GD26195@carrick.bishnet.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081112175826.GD26195@carrick.bishnet.net> X-PGP-Key: 0x5AE7D984, http://www.bishnet.net/tim/tim-bishnet-net.asc X-PGP-Fingerprint: 1453 086E 9376 1A50 ECF6 AE05 7DCE D659 5AE7 D984 User-Agent: Mutt/1.5.13 (2006-08-11) X-Bishnet-MailScanner-Information: Contact postmaster@bishnet.net X-Bishnet-MailScanner-VirusCheck: Found to be clean X-Bishnet-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.087, required 5, BAYES_00 -2.60, DNS_FROM_SECURITYSAGE 1.51, NO_RELAYS -0.00) X-Bishnet-MailScanner-From: tdb@carrick.bishnet.net Cc: Tim Bishop , Jeremy Chadwick , David Peall Subject: Re: System deadlock when using mksnap_ffs X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 19:49:42 -0000 On Wed, Nov 12, 2008 at 05:58:26PM +0000, Tim Bishop wrote: > I run the mksnap_ffs command to take the snapshot and some time later > the system completely freezes up: > > paladin# cd /u2/.snap/ > paladin# mksnap_ffs /u2 test.1 Someone (not named because they choose not to reply to the list) gave me the following patch: --- sys/ufs/ffs/ffs_snapshot.c.orig Wed Mar 22 09:42:31 2006 +++ sys/ufs/ffs/ffs_snapshot.c Mon Nov 20 14:59:13 2006 @@ -282,6 +282,8 @@ restart: if (error) goto out; bawrite(nbp); + if (cg % 10 == 0) + ffs_syncvnode(vp, MNT_WAIT); } /* * Copy all the cylinder group maps. Although the @@ -303,6 +305,8 @@ restart: goto out; error = cgaccount(cg, vp, nbp, 1); bawrite(nbp); + if (cg % 10 == 0) + ffs_syncvnode(vp, MNT_WAIT); if (error) goto out; } With the description: "What can happen is on a big file system it will fill up the buffer cache with I/O and then run out. When the buffer cache fills up then no more disk I/O can happen :-( When you do a sync, it flushes that out to disk so things don't hang." It seems to work too. But it seems more like a workaround than a fix? Tim. -- Tim Bishop http://www.bishnet.net/tim/ PGP Key: 0x5AE7D984