From nobody@FreeBSD.org  Fri Oct 12 09:15:05 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0B25E9B0
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Oct 2012 09:15:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id E90958FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Oct 2012 09:15:04 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9C9F4da028021
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Oct 2012 09:15:04 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q9C9F40V028011;
	Fri, 12 Oct 2012 09:15:04 GMT
	(envelope-from nobody)
Message-Id: <201210120915.q9C9F40V028011@red.freebsd.org>
Date: Fri, 12 Oct 2012 09:15:04 GMT
From: Alex Sav <tomefrom@list.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mksnap_ffs deadlock with journaling and some daemons
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172631
>Category:       kern
>Synopsis:       [ufs] mksnap_ffs(8) deadlock with journaling and some daemons
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mckusick
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 12 09:20:00 UTC 2012
>Closed-Date:    Sun Oct 14 03:44:22 UTC 2012
>Last-Modified:  Sun Oct 14 03:44:22 UTC 2012
>Originator:     Alex Sav
>Release:        Freebsd 9.0
>Organization:
RS
>Environment:
FreeBSD db.test 9.0-RELEASE-p4 FreeBSD 9.0-RELEASE-p4 #0: Thu Oct 11 21:35:15 GMT 2012 test@db.test:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
I have clearly installed Freebsd 9.0 and updated to p4 Freebsd 9.0

After installation 
dump -aLf- / > /var/log/tmp.dmp
and
mksnap_ffs / /.snap/snapshot
works fine.

Then I installed mysql55-server from ports and rebooted the system.

If I try to make dump with running mysql-server, system freezes and mksnap_ffs uses 100% of cpu.

If I disable journaling (tunefs -j disable /), mksnap_ffs / /.snap/snapshot works OK.

If I stop mysql-server, mksnap_ffs / /.snap/snapshot works OK.

The same problem with apache.

The problem like bin/167156, but more extensive.



>How-To-Repeat:
Instlall freebsd 9.0 amd64, update to p4, install mysql55-server from ports, start mysql and make mksnap_ffs / /.snap/snapshot

[db:/etc/mail]#mount
 /dev/aacd0p3 on / (ufs, local, journaled soft-updates)
 devfs on /dev (devfs, local, multilabel)
 /dev/aacd0p4 on /var/log (ufs, local, journaled soft-updates)

[db:/etc/mail]#pkg_info 
 cmake-2.8.9 A cross-platform Makefile generator
 cmake-modules-2.8.9 Modules and Templates for CMake
 mysql-client-5.5.27 Multithreaded SQL database (client)
 mysql-server-5.5.27 Multithreaded SQL database (server)
[db:/etc/mail]#

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-amd64->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Oct 13 01:33:17 UTC 2012 
Responsible-Changed-Why:  
reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172631 
Responsible-Changed-From-To: freebsd-fs->mckusick 
Responsible-Changed-By: mckusick 
Responsible-Changed-When: Sun Oct 14 03:42:41 UTC 2012 
Responsible-Changed-Why:  
I will take responsibility for this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172631 
State-Changed-From-To: open->closed 
State-Changed-By: mckusick 
State-Changed-When: Sun Oct 14 03:43:47 UTC 2012 
State-Changed-Why:  
There is a known interaction between journaled soft-updates and 
snapshots. Until we are able to come up with a comprehensive 
solution, we have disabled the taking of snapshots on filesystems 
running with journaled soft-updates: 

r230250 | mckusick | 2012-01-16 17:14:56 -0800 (Mon, 16 Jan 2012) | 7 lines 

There are several bugs/hangs when trying to take a snapshot on a UFS/FFS 
filesystem running with journaled soft updates. Until these problems 
have been tracked down, return ENOTSUPP when an attempt is made to 
take a snapshot on a filesystem running with journaled soft updates. 

MFC after: 2 weeks 

MFC to 9-stable occurred as: 

r230725 | mckusick | 2012-01-29 00:03:45 -0800 (Sun, 29 Jan 2012) | 13 lines 

So, kernels running 9-stable after January 29, 2012 will have this 
change. And once 9.1 is released, it will have this change. 

Jeff Roberson and I are slowing working through the issues involved. 
When we have fully fixed the problem, we will re-enable the taking 
of snapshots on filesystems running with journaled soft-updates. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172631 
>Unformatted:
