All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] scsi:donot skip lun if inquiry returns PQ=1 for all hosts
@ 2022-12-14  7:08 Wenchao Hao
  2022-12-14  7:08 ` [PATCH 1/2] scsi:core:Add sysfs interface to control if skip lun with PQ=1 Wenchao Hao
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Wenchao Hao @ 2022-12-14  7:08 UTC (permalink / raw)
  To: Martin K . Petersen, Mike Christie, James E . J . Bottomley,
	Lee Duncan, Chris Leech, open-iscsi, linux-scsi
  Cc: linux-kernel, liuzhiqiang26, linfeilong, Wenchao Hao

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(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-12-28  9:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-14  7:08 [PATCH 0/2] scsi:donot skip lun if inquiry returns PQ=1 for all hosts Wenchao Hao
2022-12-14  7:08 ` [PATCH 1/2] scsi:core:Add sysfs interface to control if skip lun with PQ=1 Wenchao Hao
2022-12-18 21:37   ` Mike Christie
2022-12-28  8:46     ` Wenchao Hao
2022-12-14  7:08 ` [PATCH 2/2] scsi:iscsi_tcp:Do not skip lun inquiry returns PQ=1 Wenchao Hao
2022-12-15  7:06 ` [PATCH 0/2] scsi:donot skip lun if inquiry returns PQ=1 for all hosts Christoph Hellwig
2022-12-15  8:07   ` Antw: [EXT] " Ulrich Windl
2022-12-16  7:11     ` Christoph Hellwig
2022-12-15  9:09   ` Wenchao Hao
2022-12-16  7:12     ` Christoph Hellwig
2022-12-16 11:41       ` Wenchao Hao
2022-12-23 15:54         ` Christoph Hellwig
2022-12-28  9:35           ` Wenchao Hao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.