Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scst_lib: Allow REPORT LUNS to operate on an unsupported LUN #223

Merged
merged 1 commit into from
May 3, 2024

Conversation

bmeagherix
Copy link
Contributor

@bmeagherix bmeagherix commented Feb 23, 2024

Initiators will attempt to send LUN 0 INQUIRY and REPORT LUNS commands when connecting to a target. If a SCST target is configured with LUNs e.g. 100, 101 (i.e. no LUN 0) then disks would NOT surface when iscsiadm is used to login on Linux. This PR is to modify SCST behavior to rectify this.

  • Add scst_set_lun_not_supported_report_luns to handle the case when REPORT LUNs is sent to an unsupported LUN.
  • Also, in scst_set_lun_not_supported_inquiry report a valid vendor identification string to promote better initiator behavior.

Tested with SCST running on:

  • Linux 6.1.20
  • Linux 6.6.16

Tested with clients:

  • Linux kernel 6.6.16 / iscsiadm version 2.1.8
  • Linux kernel 5.10.191 / iscsiadm version 2.1.3
  • Windows 11

open-iscsi/open-iscsi#175 is not wrt SCST, but offers some interesting insight nonetheless. Specifically:

  • Linux kernel was having difficulty with empty vendor/model, hence the proposed change to scst_set_lun_not_supported_inquiry.
  • The extract from SAM 5 4.7.4, hence scst_set_lun_not_supported_report_luns

All SCSI target devices shall support LUN 0 (i.e., 00000000 00000000h) or the REPORT LUNS well known logical unit. For SCSI target devices that support complex LUN structures (see 4.7.6) the LUN 0 or the REPORT LUNS well known logical unit shall be the logical unit that an application client addresses to determine information about the SCSI target device and the logical units contained within the SCSI target device.

The code in scst_set_lun_not_supported_report_luns was inspired by scst_set_lun_not_supported_inquiry and scst_report_luns_local.

Initiators will attempt to send LUN 0 INQUIRY and REPORT LUNS commands
when connecting to a target.

Add scst_set_lun_not_supported_report_luns to handle the case when REPORT
LUNs is sent to an unsupported LUN.

Also, in scst_set_lun_not_supported_inquiry report a valid vendor
identification string to promote better initiator behavior.
@lnocturno lnocturno merged commit 3fba8e4 into SCST-project:master May 3, 2024
3 checks passed
@lnocturno
Copy link
Contributor

Hi Brian,

Thank you for the patch!

Thanks,
Gleb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants