Message ID | 20221214070846.1808300-1-haowenchao@huawei.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp57908wrn; Tue, 13 Dec 2022 23:18:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf5A2DBMPIYtMLn/tjQG1alPbBJz/T7wh6afElou3Xc6FhGmNAuv52gHJfiFwyAyuVAihei8 X-Received: by 2002:a17:907:7850:b0:7c3:15cc:76d0 with SMTP id lb16-20020a170907785000b007c315cc76d0mr1963554ejc.47.1671002300361; Tue, 13 Dec 2022 23:18:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671002300; cv=none; d=google.com; s=arc-20160816; b=1LxaXUfPoIRuvQLj7q/QTJiVYLIWsM66zpSH57JJ5nrZ0EDUHiU8BkgzJHEV9F48tv my/ZVmDHid8feTIjY27RELRrRpauuL7q+/Nxd6u4+s57MBTUyrc/ZBtN5cL+HrVEB5/W Qra/04jB+vYxwPJ2aokO75CdtXbjjDqPdZJ6acLo+kvilrvDKEnl7vZKevpP70jdy66R vg1azvMseMhmZmUZrQTvbQE6ADioifQYWCzRBFOp0EuPbIw34gvyUYTzExmLpq+kUFQ+ jzQt4+XPntVn6G4h7a4Gjf+ylg+JsOQHjnkTWsl+Cvu/ih7UwxUewx8xwIuxaUeWJoJA 1NWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=nInrpxmmMlCkZidsUdjXn1rKxtcAkcwIilkaQjbMF0Q=; b=cSSlIoJ3lU0/PgIBd8wiE6Zm8ZktK9oqIBYTm9UYnoKqgsDUo1zKeF+q7y+Em1KHNy ywY7Zm6GBl/VJzD+zucy5vENzdlMLWJNVGqNK7VCXyT4Ao1kNPEsgZ+vVREjbH4hC6VU Sqhyx7H5paUBrDzRM7Nrq39NnQKSmuNypvAOP7w6jtXj3vIUIz9zmn6NUSNdk8O6ko4q i/OiHjvCUf5icTMfCE9KyWoiOXl4WxJxCPmeRnrkrAm8Dd420Qil7tzE5A07ewMboNRT cFwlU7z4nqvjnB3vw/+ctoaoyofnCFdPo1x7CeC/GbUSKp+GzlpFGcpff71xYlILYjJr /gXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rq5-20020a17090788c500b007807e1f3d9dsi9104448ejc.842.2022.12.13.23.17.56; Tue, 13 Dec 2022 23:18:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237519AbiLNHJZ (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Wed, 14 Dec 2022 02:09:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237499AbiLNHJP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 14 Dec 2022 02:09:15 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF7D6C34; Tue, 13 Dec 2022 23:09:13 -0800 (PST) Received: from dggpemm500017.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NX5zv2WLyzRq37; Wed, 14 Dec 2022 15:08:11 +0800 (CST) Received: from build.huawei.com (10.175.101.6) by dggpemm500017.china.huawei.com (7.185.36.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 14 Dec 2022 15:09:11 +0800 From: Wenchao Hao <haowenchao@huawei.com> To: "Martin K . Petersen" <martin.petersen@oracle.com>, Mike Christie <michael.christie@oracle.com>, "James E . J . Bottomley" <jejb@linux.ibm.com>, Lee Duncan <lduncan@suse.com>, Chris Leech <cleech@redhat.com>, <open-iscsi@googlegroups.com>, <linux-scsi@vger.kernel.org> CC: <linux-kernel@vger.kernel.org>, <liuzhiqiang26@huawei.com>, <linfeilong@huawei.com>, Wenchao Hao <haowenchao@huawei.com> Subject: [PATCH 0/2] scsi:donot skip lun if inquiry returns PQ=1 for all hosts Date: Wed, 14 Dec 2022 15:08:44 +0800 Message-ID: <20221214070846.1808300-1-haowenchao@huawei.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500017.china.huawei.com (7.185.36.178) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752172907891003980?= X-GMAIL-MSGID: =?utf-8?q?1752172907891003980?= |
Series |
scsi:donot skip lun if inquiry returns PQ=1 for all hosts
|
|
Message
Wenchao Hao
Dec. 14, 2022, 7:08 a.m. UTC
commit 948e922fc4461 ("scsi: core: map PQ=1, PDT=other values to SCSI_SCAN_TARGET_PRESENT") returns SCSI_SCAN_TARGET_PRESENT if inquiry returns PQ=1. According to the SPC, PQ=1 means the addressed logical unit having the indicated device type is not accessible, it does not mean the addressed logical unit is invalid. We still can map this lun to an sg device. In some conditions, we do not want to skip these devices, for example with iSCSI: When iSCSI initiator logged in target, the target attached none valid lun but lun0. lun0 is not an valid disk, while it would response inquiry command with PQ=1 and other general scsi commands like probe lun. The others luns of target is added/removed dynamicly. We want the lun0 to be mapped to an sg device in initiator, so we can probe luns of target based on lun0. In first patch, I add an interface to control if to skip luns return PQ=1 for inquiry. In second patch, make iscsi_tcp do not skip luns return PQ=1 as default, since I do not have iscsi_tcp environment, so here just modified the iscsi_tcp. Wenchao Hao (2): scsi:core:Add sysfs interface to control if skip lun with PQ=1 scsi:iscsi_tcp:Do not skip lun inquiry returns PQ=1 drivers/scsi/iscsi_tcp.c | 1 + drivers/scsi/scsi_scan.c | 9 ++++++--- drivers/scsi/scsi_sysfs.c | 29 +++++++++++++++++++++++++++++ include/scsi/scsi_host.h | 3 +++ 4 files changed, 39 insertions(+), 3 deletions(-)
Comments
On Wed, Dec 14, 2022 at 03:08:44PM +0800, Wenchao Hao wrote: > When iSCSI initiator logged in target, the target attached none valid > lun but lun0. lun0 is not an valid disk, while it would response > inquiry command with PQ=1 and other general scsi commands like probe lun. > The others luns of target is added/removed dynamicly. I can't find any special casing of LUN0 in RFC7144, can you clarify where you think that treats LUN0 any differently than other transports?
>>> Christoph Hellwig <hch@infradead.org> schrieb am 15.12.2022 um 08:06 in Nachricht <Y5rHX95Vvl1aLhbp@infradead.org>: > On Wed, Dec 14, 2022 at 03:08:44PM +0800, Wenchao Hao wrote: >> When iSCSI initiator logged in target, the target attached none valid >> lun but lun0. lun0 is not an valid disk, while it would response >> inquiry command with PQ=1 and other general scsi commands like probe lun. >> The others luns of target is added/removed dynamicly. > > I can't find any special casing of LUN0 in RFC7144, can you clarify > where you think that treats LUN0 any differently than other transports? Actusally I have no idea, but as a user of FC SAN systems I can remember a case when a storage system had to present a dummy LUN0 to enable hosts to find other LUNs (while LUN0 was never actually used). Maybe the client code was imperfect, I don't know. > > -- > You received this message because you are subscribed to the Google Groups > "open-iscsi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to open-iscsi+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/open-iscsi/Y5rHX95Vvl1aLhbp%40infradead.org > .
On 2022/12/15 15:06, Christoph Hellwig wrote: > On Wed, Dec 14, 2022 at 03:08:44PM +0800, Wenchao Hao wrote: >> When iSCSI initiator logged in target, the target attached none valid >> lun but lun0. lun0 is not an valid disk, while it would response >> inquiry command with PQ=1 and other general scsi commands like probe lun. >> The others luns of target is added/removed dynamicly. > > I can't find any special casing of LUN0 in RFC7144, can you clarify > where you think that treats LUN0 any differently than other transports? > . This is not described in RFC7144. The sense described above aims to tell that a dummy lun is useful. In my opinion, if the addressed lun still response the inquiry and other commands, we should not skip it, maybe let the scsi drivers like sd/st/sg to determine how to handle this lun accordint to the PQ value. As discussed in following mail, another drivers would be broken too. https://lore.kernel.org/linux-scsi/CA+PODjqrRzyJnOKoabMOV4EPByNnL1LgTi+QAKENP3NwUq5YCw@mail.gmail.com/ The key point of my patch is to add one way to map dummy lun to an sg device.
On Thu, Dec 15, 2022 at 09:07:28AM +0100, Ulrich Windl wrote:
> Actusally I have no idea, but as a user of FC SAN systems I can remember a case when a storage system had to present a dummy LUN0 to enable hosts to find other LUNs (while LUN0 was never actually used). Maybe the client code was imperfect, I don't know.
Ignoring some of the well known LU bits that never really became
practically relevant, lun0 is needed to use the REPORT_LUNS command
to scane for the other logical units. But unless the PQ says it
actually is a valid logic unit, we never add a sdev for it.
On Thu, Dec 15, 2022 at 05:09:31PM +0800, Wenchao Hao wrote: > In my opinion, if the addressed lun still response the > inquiry and other commands, we should not skip it, > maybe let the scsi drivers like sd/st/sg to determine > how to handle this lun accordint to the PQ value. > > As discussed in following mail, another drivers would > be broken too. So why do you force a specific behavior for iSCSI?
On 2022/12/16 15:12, Christoph Hellwig wrote: > On Thu, Dec 15, 2022 at 05:09:31PM +0800, Wenchao Hao wrote: >> In my opinion, if the addressed lun still response the >> inquiry and other commands, we should not skip it, >> maybe let the scsi drivers like sd/st/sg to determine >> how to handle this lun accordint to the PQ value. >> >> As discussed in following mail, another drivers would >> be broken too. > > So why do you force a specific behavior for iSCSI? > . For nothing, I want the iscsi_tcp transport do not skip PQ=1 default as what it did before commit 948e922fc4461 ("scsi: core: map PQ=1, PDT=other values to SCSI_SCAN_TARGET_PRESENT").
On Fri, Dec 16, 2022 at 07:41:26PM +0800, Wenchao Hao wrote: > For nothing, I want the iscsi_tcp transport do not skip PQ=1 default > as what it did before commit 948e922fc4461 ("scsi: core: map PQ=1, > PDT=other values to SCSI_SCAN_TARGET_PRESENT"). Well, that commit was very much intentional and is now three an a half years old, so we've not just going to partially revert it on a per-transport basis when it is in no way transport related. If you can come up with a good enough rationale we could do the sysfs override, but so far the reason mostly seems to be "I want" and not anctual explanation of why it is useful.