From nobody@FreeBSD.org  Thu Apr  4 14:20:28 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id 25B8DB35
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  4 Apr 2013 14:20:28 +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 F10B9617
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  4 Apr 2013 14:20:27 +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 r34EKRFM015739
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 4 Apr 2013 14:20:27 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r34EKRTQ015738;
	Thu, 4 Apr 2013 14:20:27 GMT
	(envelope-from nobody)
Message-Id: <201304041420.r34EKRTQ015738@red.freebsd.org>
Date: Thu, 4 Apr 2013 14:20:27 GMT
From: Scott Kitchin <scott@kitchin.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FreeBSD 9.1 and ZFS deadlocked at shutdown/reboot
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         177633
>Category:       amd64
>Synopsis:       FreeBSD 9.1 and ZFS deadlocked at shutdown/reboot
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-amd64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 04 14:30:00 UTC 2013
>Closed-Date:    Mon Apr 08 16:43:57 UTC 2013
>Last-Modified:  Mon Apr 08 16:43:57 UTC 2013
>Originator:     Scott Kitchin
>Release:        9.1-RELENG r248699
>Organization:
Novysoft
>Environment:
FreeBSD web 9.1-RELEASE-p1 FreeBSD 9.1-RELEASE-p1 #0 r248699: Mon Mar 25 18:31:53 MSK 2013     root@:/usr/obj/usr/src/sys/NOVYSOFT  amd64

>Description:
I tried FreeBSD 9.1 (RELEASE/RELENG/STABLE) with ZFS mirrored (raid1) pool and iRedMail (http://www.iredmail.org) and it hangs when I issue a shutdown command. The only last message displayed "All buffers synched" and it hangs indefinitely until I hit the reset/power button.

FreeBSD 9.1 with ZFS (raid1) pool shutdown hang/deadlock.
FreeBSD 9.1 without ZFS shutdown successful.
FreeBSD 9.0 with ZFS shutdown successful.
FreeBSD 9.0 without ZFS shutdown successful.

This only happens after I install iRedMail. If I uninstall or delete iRedMail and it shutdowns normal. If I reinstall iRedMail and it hangs. iRedMail's mail daemons must be causing some kind of deadlock and preventing FreeBSD 9.1 from normal shutdown. I think this is serious problem if the server is at a remote location without physical access to power button.

I was able to reproduce this problem in VirtualBox with two virtual drives for ZFS pool mirroring and two different computers.

The server can be shutdown using this command 'shutdown -n -o -r now' but it's risky.
>How-To-Repeat:
1) Install FreeBSD 9.1 with ZFS mirrored (raid1) pools
2) Install Bash from ports
3) Install iRedMail from http://www.iredmail.org
4) Shutdown to start all services
5) Shutdown again and it hangs

I use ZFS creation tool from http://iceblood.googlecode.com/svn/FreeBSD_ZFS/freebsd_zfs_inst.sh
>Fix:
N/A

>Release-Note:
>Audit-Trail:

From: Andriy Gapon <avg@FreeBSD.org>
To: bug-followup@FreeBSD.org, scott@kitchin.com
Cc:  
Subject: Re: amd64/177633: FreeBSD 9.1 and ZFS deadlocked at shutdown/reboot
Date: Thu, 04 Apr 2013 18:32:48 +0300

 I believe that this should be fixed in stable/9.
 
 -- 
 Andriy Gapon

From: Palle Girgensohn <girgen@pingpong.net>
To: Scott Kitchin <scott@kitchin.com>
Cc: "freebsd-gnats-submit@FreeBSD.org" <freebsd-gnats-submit@FreeBSD.org>
Subject: Re: amd64/177633: FreeBSD 9.1 and ZFS deadlocked at shutdown/reboot
Date: Thu, 4 Apr 2013 18:11:39 +0200

 Does the ireadmail rc.d script work for properly for the "stop" command?

From: Scott Kitchin <scott@kitchin.com>
To: bug-followup@FreeBSD.org, scott@kitchin.com
Cc:  
Subject: Re: amd64/177633: FreeBSD 9.1 and ZFS deadlocked at shutdown/reboot
Date: Mon, 08 Apr 2013 19:29:28 +0400

 Latest -STABLE/9 branch fixed this problem.
 
 Please close this ticket.
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Mon Apr 8 16:43:46 UTC 2013 
State-Changed-Why:  
Closed at submitter's request. 

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