From owner-freebsd-current@FreeBSD.ORG Thu Dec 31 14:19:11 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E83611065694 for ; Thu, 31 Dec 2009 14:19:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BA39E8FC0C for ; Thu, 31 Dec 2009 14:19:11 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 56C3D46B35; Thu, 31 Dec 2009 09:19:11 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 06B008A01B; Thu, 31 Dec 2009 09:18:59 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Date: Thu, 31 Dec 2009 08:49:07 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <4C83129A-00FE-4E93-8F65-BFAE4B6F6BC7@mac.com> In-Reply-To: <4C83129A-00FE-4E93-8F65-BFAE4B6F6BC7@mac.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912310849.07829.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 31 Dec 2009 09:18:59 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Marcel Moolenaar Subject: Re: panic: mutex Giant owned at /tank/usr/src/sys/kern/kern_thread.c:357 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 14:19:12 -0000 On Wednesday 30 December 2009 4:55:44 pm Marcel Moolenaar wrote: > All, > > We still have a ZFS-triggerable panic. The conditions under which the panic > happens are "simple": > > 1. Create a mount-point /dos, and mount a MS-DOS file system > there. > 2. Create directory /dos/zfs > 3. Make /boot/zfs a symlink to /dos/zfs > 4. create or import a pool, like "zpool import tank" > > ZFS will create/update the zpool cache (/boot/zfs/zpool.cache) > and when done exits the zfskern/solthread thread, at which time > the panic happens: > > panic: mutex Giant owned at /tank/usr/src/sys/kern/kern_thread.c:357 > cpuid = 0 > KDB: enter: panic > [thread pid 8 tid 100147 ] > Stopped at kdb_enter+0x92: [I2] addl r14=0xffffffffffe1f3f0,gp ;; > db> show alllocks > Process 8 (zfskern) thread 0xe000000010df4a20 (100147) > exclusive sleep mutex process lock (process lock) r = 0 (0xe000000010407660) locked @ /tank/usr/src/sys/kern/kern_kthread.c:326 > exclusive sleep mutex Giant (Giant) r = 1 (0xe0000000048f8da8) locked @ /tank/usr/src/sys/kern/vfs_lookup.c:755 > > It looks to me that this is a bug in vfs_lookup.c, but I'm not > savvy enough to know this for sure or fix it fast myself. Help > is welcome, because this particular bug hits ia64 hard: /boot > is a symlink to /efi/boot, where /efi is a msdosfs mount point. Can you get a stack trace? The bug is probably that ZFS isn't properly honoring NDHASGIANT() someplace. Hmm, it certainly doesn't honor it in lookupnameat(). You could maybe have it unlock Giant there, but I believe that will result in ZFS not acquiring Giant for any vnode operations on a returned vnode from a !MPSAFE filesystem. -- John Baldwin