Date: Wed, 7 Mar 2012 13:22:00 -0700 From: "Kenneth D. Merry" <ken@freebsd.org> To: Chuck Tuffli <chuck@tuffli.net> Cc: freebsd-scsi <freebsd-scsi@freebsd.org> Subject: Re: [patch] CTL should check condition INQUIRY with invalid LUN Message-ID: <20120307202200.GA23825@nargothrond.kdm.org> In-Reply-To: <CAM0tzX2y=Nh7MjM%2BDhZJu-CPYqUhvBsJCVjPsagTXmR3v_2_Hw@mail.gmail.com> References: <CAM0tzX1=OrfYK3za9s5xkiUDmnO=maHPbhmyv0k50y=6-WTT9w@mail.gmail.com> <20120306001731.GA38229@nargothrond.kdm.org> <CAM0tzX2y=Nh7MjM%2BDhZJu-CPYqUhvBsJCVjPsagTXmR3v_2_Hw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 06, 2012 at 16:30:22 -0800, Chuck Tuffli wrote: > On Mon, Mar 5, 2012 at 4:17 PM, Kenneth D. Merry <ken@freebsd.org> 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. ?What version are you testing with? > > RHEL 6.1 > > > Returning a check condition is not correct according to the spec. ?This 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. Hmm, that sounds suspicious. What is the exact ASC/ASCQ reported? Are you setting the tag_action field in the ATIO that gets sent to CTL? Only one untagged command is allowed at a time. If the tag action is getting set to simple, ordered, etc., then we need to make sure that the same tag IDs aren't in use at the same time. Ken -- Kenneth Merry ken@FreeBSD.ORG
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120307202200.GA23825>