Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Nov 2008 23:08:39 +0000
From:      Tim Bishop <tim@bishnet.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/128832: System deadlock when using mksnap_ffs
Message-ID:  <E1L0OpD-00079O-0L@paladin.sixth.bishnet.net>
Resent-Message-ID: <200811122310.mACNA1Om053383@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         128832
>Category:       kern
>Synopsis:       System deadlock when using mksnap_ffs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 12 23:10:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Tim Bishop
>Release:        FreeBSD 7.1-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD paladin 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #9: Wed Nov 12 18:47:56 GMT 2008 tdb@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.

>Description:
	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
	slow.

	Some discussion on freebsd-stable:

	http://lists.freebsd.org/pipermail/freebsd-stable/2008-November/046524.html

>How-To-Repeat:
	paladin# cd /u2/.snap
	paladin# mksnap_ffs /u2 test.1

>Fix:
	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;
 		bawrite(nbp);
+		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);
 		bawrite(nbp);
+		if (cg % 10 == 0)
+			ffs_syncvnode(vp, MNT_WAIT);
 		if (error)
 			goto out;
 	}
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1L0OpD-00079O-0L>