kern/128832: System deadlock when using mksnap_ffs

Tim Bishop tim at
Wed Nov 12 15:10:01 PST 2008

>Number:         128832
>Category:       kern
>Synopsis:       System deadlock when using mksnap_ffs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 12 23:10:00 UTC 2008
>Originator:     Tim Bishop
>Release:        FreeBSD 7.1-PRERELEASE amd64
System: FreeBSD paladin 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #9: Wed Nov 12 18:47:56 GMT 2008 tdb at paladin:/usr/obj/usr/src/sys/PALADIN amd64

	Filesystem details:

	Filesystem  1K-blocks       Used     Avail Capacity  Mounted on
	/dev/da0s1a 2078881084 925352744 987217854    48%    /u2

	It's NFS exported and it's mounted from a RAID card using
	the twa driver.

	When running mksnap_ffs on the above filesystem the system
	completely freezes up. The console is unresponsive, and
	even after a couple of hours there is still no response. I
	guess it deadlocked, but it may just be being incredibly

	Some discussion on freebsd-stable:

	paladin# cd /u2/.snap
	paladin# mksnap_ffs /u2 test.1

	This fix was provided to me in response to my post on
	freebsd-stable. It's against 7-STABLE. I can see what it's
	doing, but don't understand the bigger picture enough to
	know if it's sensible.

--- sys/ufs/ffs/ffs_snapshot.c.orig	2008-11-12 18:40:53.000000000 +0000
+++ sys/ufs/ffs/ffs_snapshot.c	2008-11-12 18:42:19.000000000 +0000
@@ -345,6 +345,8 @@
 		if (error)
 			goto out;
+		if (cg % 10 == 0)
+			ffs_syncvnode(vp, MNT_WAIT);
 	 * Copy all the cylinder group maps. Although the
@@ -366,6 +368,8 @@
 			goto out;
 		error = cgaccount(cg, vp, nbp, 1);
+		if (cg % 10 == 0)
+			ffs_syncvnode(vp, MNT_WAIT);
 		if (error)
 			goto out;

More information about the freebsd-bugs mailing list