Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Nov 2008 19:49:28 +0000
From:      Tim Bishop <tim-lists@bishnet.net>
To:        freebsd-stable@freebsd.org
Cc:        Tim Bishop <tim@bishnet.net>, Jeremy Chadwick <koitsu@FreeBSD.org>, David Peall <david@esn.org.za>
Subject:   Re: System deadlock when using mksnap_ffs
Message-ID:  <20081112194928.GA19539@carrick.bishnet.net>
In-Reply-To: <20081112175826.GD26195@carrick.bishnet.net>
References:  <20081112175826.GD26195@carrick.bishnet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081112194928.GA19539>