From owner-freebsd-scsi@FreeBSD.ORG Wed Apr 8 15:40:39 2015 Return-Path: Delivered-To: freebsd-scsi@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 3154FF28 for ; Wed, 8 Apr 2015 15:40:39 +0000 (UTC) Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) (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 BD208B89 for ; Wed, 8 Apr 2015 15:40:38 +0000 (UTC) Received: by wgsk9 with SMTP id k9so69919924wgs.3 for ; Wed, 08 Apr 2015 08:40:31 -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:cc:content-type; bh=iiUc36fvrpSoDwOvkQCbau2tLjsQtzgdOaZKRoc/Ipc=; b=IMtUayASJ5YLyTWQIxQdgaRP0pX014jGCpspIE914oydT6L6xMnRQDH/Wv35k3zhhs E6va3yiehGSYqpslT7cCydfXETkLFPRegLZpRz12o8pRg/w3gS2mWzH6okk3Knj71wPn RA+krNzIZc5u9ncisx92YK3IUAYnRRS6dIHXX+4cotEasDEJmf84fkRDC6afgu2YRG9s NWGl3NFCiNry4TnkXS04SlVCcRTr/czrPS7koNPX4W070Ji/WDXxG55EAoUzAYhBFZ/i DMef3wY1TTH38VX/WabHcLhaLzQyusMg1hBiPFVs9F5z4vax6NhgGb1lsHBp++6N4nCr kOgA== X-Gm-Message-State: ALoCoQnckO3hKW0UupqCGSD2P++3hjmrkjB46QJkuhkkMCqQd35yWm8TF2ezdiJMPJNaCtzPLWc1 X-Received: by 10.195.12.97 with SMTP id ep1mr52298752wjd.134.1428507631523; Wed, 08 Apr 2015 08:40:31 -0700 (PDT) From: Sibananda Sahu MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdByElXStoOcI9WhRiGEYM1YJOJM1w== Date: Wed, 8 Apr 2015 21:10:27 +0530 Message-ID: Subject: scsi_scan_bus in FreeBSD 10.1 has mutex unlock and lock swapped To: freebsd-scsi@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "Kenneth D. Merry" , scottl@freebsd.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2015 15:40:39 -0000 Hi, Recently I was working with mpslsi3 driver and found that the system just crashed at xpt_action() call. 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 From owner-freebsd-scsi@FreeBSD.ORG Sat Apr 11 13:04:15 2015 Return-Path: Delivered-To: freebsd-scsi@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 992563FD for ; Sat, 11 Apr 2015 13:04:15 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (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 27F5F28 for ; Sat, 11 Apr 2015 13:04:15 +0000 (UTC) Received: by wgyo15 with SMTP id o15so40861213wgy.2 for ; Sat, 11 Apr 2015 06:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=IRvUYC4om8gJtGVdSrNBLxkPIVilRsckEfVXyb3FB+g=; b=WTkMY8NCHTSceFVckhDHe+CS1qit/dI1p9TDeALeo1pUtHdykFiqb9O5f5YiaUxJD3 gd2PQSfQ3+R2KKK6ENPZpjea6ZkS8Mop7VjsZV4dVreHbZ7bI1ExkFJtcNHQJJ/ldyJv VF58ywxWpvhr77FMhRxaXCpY7LIgTq182Pi7b5kqcDLLLLxnkkEXXh3/OjHuhbokP3nb t9claLvcI3rdKnbWVlTtMKlx6RfidXh+43gLsiqMqv1j7ORnFLjU4Kr+g3IWLFpGP2Xo uxC/peA0r4wFcEdaXkjhl0fm1Ircl6MeXSuwmAWB3/O0wFEOZ+JP9zXKpgBzHnt0D3LB oaxw== X-Received: by 10.194.47.231 with SMTP id g7mr11120663wjn.140.1428757452976; Sat, 11 Apr 2015 06:04:12 -0700 (PDT) Received: from brick.home (aeer91.neoplus.adsl.tpnet.pl. [79.186.121.91]) by mx.google.com with ESMTPSA id e2sm2734926wij.5.2015.04.11.06.04.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Apr 2015 06:04:12 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sat, 11 Apr 2015 15:04:09 +0200 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Aafak Mohammad Subject: Re: Cannot create Pool on discovered iSCSI targets Message-ID: <20150411130409.GA9711@brick.home> Mail-Followup-To: Aafak Mohammad , freebsd-scsi@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-scsi@freebsd.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2015 13:04:15 -0000 On 0401T1054, Aafak Mohammad wrote: > HI > I have installed freebsd 10.1 and using iscsictl as initiator > root@freebsd-10:~ # uname -a > *FreeBSD freebsd-10.1 10.1-RC3* FreeBSD 10.1-RC3 #0 r273437: Tue Oct 21 > 23:55:15 UTC 2014 > root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC > amd64 > root@freebsd-10:~ # > Then i discovered iSCSI targate exist on Nexenta its connected and can see > the devicenode in camcontrol devlist > > *root@freebsd-10:~ # iscsictl -A -d 20.10.20.7 * > root@freebsd-10:~ # iscsictl > Target name Target portal State > iqn.1986-03.com.sun:02:b3031b28-29d1-40d5-9f02-a95a428d096e > 20.10.20.7 Connected: da1 > root@freebsd-10:~ # iscsictl -v > Session ID: 2 > Initiator name: iqn.1994-09.org.freebsd:freebsd-10.1 > Initiator portal: > Initiator alias: > Target name: > iqn.1986-03.com.sun:02:b3031b28-29d1-40d5-9f02-a95a428d096e > Target portal: 20.10.20.7 > Target alias: > User: > Secret: > Mutual user: > Mutual secret: > Session type: Normal > *Session state: Connected* > Failure reason: > Header digest: None > Data digest: None > DataSegmentLen: 32768 > ImmediateData: Yes > iSER (RDMA): No > *Device nodes: da1 * > > *root@freebsd-10:~ # camcontrol devlist* > at scbus1 target 0 lun 0 (cd0,pass0) > at scbus2 target 0 lun 0 (da0,pass1) > * at scbus3 target 0 lun 0 (pass2,da1)* > *root@freebsd-10:~ # zpool create pool1 /dev/da1* > > getting hung........... making it as a kernel thread > > *var/log/messages/* > Apr 1 10:37:43 freebsd-10 kernel: WARNING: 20.10.20.7 > (iqn.1986-03.com.sun:02:b3031b28-29d1-40d5-9f02-a95a428d096e): connection > error; reconnecting First of all - do you see any errors on the target (Nexenta) side? Second - instead of creating zpool, can you do some simple tests? Do "diskinfo -t /dev/da1", "newfs /dev/da1", and 'fsck /dev/da1"; this will show you whether the basic functionality works. If it does - try to set those in /boot/loader.conf: vfs.zfs.vdev.trim_on_init=0 vfs.zfs.trim.enabled=0 then reboot and try to create zpool.