From owner-freebsd-bugs@FreeBSD.ORG Thu Apr 9 10:10:59 2015 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FE02E07 for ; Thu, 9 Apr 2015 10:10:59 +0000 (UTC) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1CAFD57 for ; Thu, 9 Apr 2015 10:10:58 +0000 (UTC) Received: by wiaa2 with SMTP id a2so91903531wia.0 for ; Thu, 09 Apr 2015 03:10:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:thread-index:date:message-id :subject:to:content-type; bh=AzX0hKFZBn6cJqdbjlicy29ShghKO0ynIKTICt9rjVw=; b=GOF1uVgUtZQ1VoCwHDQuza5mMQvGt/2o73mPvqTFcE2y1y8sNP7MafNFS/4+Tlo1OU hYgyGeLiYMwYkSFCvMF7zrhz6vTXTkr0aHOre3r3Rf2dGrEbVnF8p39/4ttfdpkfaTUd o8CuugeI2kdNJRQC08OZnfv4z8Zflws6z5F/TmiZaIkgaPtoq0ciDNjsHZhYbctas0EE b9owJ3zZFyHt9esSSJB11uEQhXUl7vAT15h/GdBLMXICazUeMnhs2EorIklaA7YEG6Yd PDWgqLM2Y5/AMty8dk4e8bDW7MasUbxzv+YiCmtx3z9W8UpDJkA6BAGydFUdOvV+j0nj 37IA== X-Gm-Message-State: ALoCoQnkRTUfuLae7WYPgr/r4RADmHuzOoE5BzaOezuPxw1hFk1zUwQgX2h/EMsZMShcOjKd5bSQ X-Received: by 10.194.235.71 with SMTP id uk7mr58959915wjc.13.1428574251090; Thu, 09 Apr 2015 03:10:51 -0700 (PDT) From: Sibananda Sahu MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdByrXH0+n9m5lx5RDiB72nx/SizrA== Date: Thu, 9 Apr 2015 15:40:50 +0530 Message-ID: <2fa5e95f922badfba3ccf4dfd96e524e@mail.gmail.com> Subject: scsi_scan_bus in FreeBSD 10.1 has mutex unlock and lock swapped To: freebsd-bugs@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2015 10:10:59 -0000 Hi, Recently I was working with mpslsi3 driver and found that the system just crashed at xpt_action() call. The same driver code is working just fine with other versions of FreeBSD. After digging a little into the CAM layer code I found that: inside scsi_scan_bus()at line number: 1935 first mutex_unlock(mtx) is called and then at line 1974 called mtx_lock(mtx) just before exiting the XPT_SCAN_BUS case. I just swapped the calls and called mutex_lock() first and then called mutex_unlock() and found there is no kernel panic. Driver was loaded just fine but after a while I was unable to operate the system. But pinging to the system was working and the system was up. Is it OK or it looks to be a bug? Thanks, Sibananda Sahu