From owner-freebsd-stable@FreeBSD.ORG Wed Sep 26 00:59:16 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAB081065738 for ; Wed, 26 Sep 2012 00:59:15 +0000 (UTC) (envelope-from prvs=1616559884=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id 76DDA8FC16 for ; Wed, 26 Sep 2012 00:59:15 +0000 (UTC) Received: from r2d2 ([188.220.16.49]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50000231669.msg for ; Wed, 26 Sep 2012 01:58:46 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Wed, 26 Sep 2012 01:58:46 +0100 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 188.220.16.49 X-Return-Path: prvs=1616559884=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-stable@freebsd.org Message-ID: From: "Steven Hartland" To: Date: Wed, 26 Sep 2012 01:58:47 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Subject: 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 00:59:16 -0000 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); Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk.