From owner-freebsd-scsi@FreeBSD.ORG Wed Mar 7 00:30:23 2012 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E2471065678 for ; Wed, 7 Mar 2012 00:30:23 +0000 (UTC) (envelope-from chuck@tuffli.net) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6696B8FC1D for ; Wed, 7 Mar 2012 00:30:23 +0000 (UTC) Received: by obbwc7 with SMTP id wc7so8920399obb.13 for ; Tue, 06 Mar 2012 16:30:22 -0800 (PST) Received-SPF: pass (google.com: domain of chuck@tuffli.net designates 10.182.54.114 as permitted sender) client-ip=10.182.54.114; Authentication-Results: mr.google.com; spf=pass (google.com: domain of chuck@tuffli.net designates 10.182.54.114 as permitted sender) smtp.mail=chuck@tuffli.net Received: from mr.google.com ([10.182.54.114]) by 10.182.54.114 with SMTP id i18mr10621102obp.49.1331080222902 (num_hops = 1); Tue, 06 Mar 2012 16:30:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.54.114 with SMTP id i18mr9315365obp.49.1331080222821; Tue, 06 Mar 2012 16:30:22 -0800 (PST) Received: by 10.60.67.226 with HTTP; Tue, 6 Mar 2012 16:30:22 -0800 (PST) In-Reply-To: <20120306001731.GA38229@nargothrond.kdm.org> References: <20120306001731.GA38229@nargothrond.kdm.org> Date: Tue, 6 Mar 2012 16:30:22 -0800 Message-ID: From: Chuck Tuffli To: "Kenneth D. Merry" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQnmqa/K0UH7uMCHX2C9fV7o3JQpVmGl1AGiT2gvPegIwozaWSJdytbXM+3ytp+qIF+Pe9lW Cc: freebsd-scsi Subject: Re: [patch] CTL should check condition INQUIRY with invalid LUN X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 00:30:23 -0000 On Mon, Mar 5, 2012 at 4:17 PM, Kenneth D. Merry wrote: > On Mon, Mar 05, 2012 at 14:46:52 -0800, Chuck Tuffli wrote: >> Currently, the CTL responds to INQUIRY commands targeted at invalid >> LUNs by returning valid data with the peripheral qualifier set to LU >> OFFLINE. This patch instead returns a check condition with LU NOT >> READY. >> >> Linux initiators see the LU OFFLINE and start creating SG devices, but >> are not able to finish. The offline also causes them to keep probing >> LUNs. > > Linux used to behave properly. =A0What version are you testing with? RHEL 6.1 > Returning a check condition is not correct according to the spec. =A0This= is > from SPC-4 (r31): > > "In response to an INQUIRY command received by an incorrect logical unit, > the SCSI target device shall return the INQUIRY data with the peripheral > qualifier set to the value defined in 6.4.2. The INQUIRY command shall > return CHECK CONDITION status only when the device server is unable to > return the requested INQUIRY data." You are correct, so I agree the patch I submitted yesterday is wrong, but := ) > Since CTL can support a LUN at the requested address, but there isn't one > there, it returns OFFLINE status. this offline status causes Linux to create 255 sg additional devices. While this isn't directly a CTL problem, I'm sure I will end up having to explain why this happens more than once and would rather head off the problem. Would you be willing to consider changing the returned peripheral qualifier from (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT to (SID_QUAL_BAD_LU << 5) | T_NODEVICE ? Linux seems happier with this FWIW. > They should be issuing a REPORT LUNs and then probe the LUNs that are > returned... Linux does issue REPORT LUNs, but most of the time, this gets check-conditioned with illegal request, overlapped commands attempted. ---chuck