From owner-freebsd-stable@FreeBSD.ORG Wed Sep 26 14:14:39 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A61D1065673 for ; Wed, 26 Sep 2012 14:14:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id E2E348FC16 for ; Wed, 26 Sep 2012 14:14:38 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 330FDB983; Wed, 26 Sep 2012 10:14:38 -0400 (EDT) From: John Baldwin To: freebsd-stable@freebsd.org Date: Wed, 26 Sep 2012 10:14:13 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201209261014.13064.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 26 Sep 2012 10:14:38 -0400 (EDT) Cc: Steven Hartland Subject: Re: Lock MFI config not exclusively locked - panic X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2012 14:14:39 -0000 On Tuesday, September 25, 2012 9:37:41 pm Steven Hartland wrote: > ----- Original Message ----- > > I've been testing some enhancements to mfiutil so compiled > > kernel in debug with:- > > options INVARIANTS > > options INVARIANT_SUPPORT > > options DDB > > options MFI_DEBUG > > > > After doing that and running mfiutil to import a foreign > > config I get a panic with:- > > Lock MFI config not exclusively locked @ /usr/src/sys/dev/mfi/mfi.c:1001 > > > > Looking at the code this was trigged by the mfi_ldprobe from > > mfi_check_command_post which doesn't do any locking. > > > > Is the correct fix for this to wrap all the calls to mfi_ldprobe > > with config and io lock as per mfi_startup e.g. > > sx_xlock(&sc->mfi_config_lock); > > mtx_lock(&sc->mfi_io_lock); > > mfi_ldprobe(sc); > > mtx_unlock(&sc->mfi_io_lock); > > sx_xunlock(&sc->mfi_config_lock); > > Replying to my own posts again, but just spotted mfi_config_lock > method and seems its just missing MFI_DCMD_CFG_FOREIGN_IMPORT > which is required for user commands. > > Adding it fixes this panic :) Committed, thanks! -- John Baldwin