[Merge] ~rafaeldtinoco/ubuntu/+source/sg3-utils:lp1833618-bionic into ubuntu/+source/sg3-utils:ubuntu/bionic-devel
Ryan Harper
ryan.harper at canonical.com
Thu Oct 17 22:31:26 UTC 2019
One comment for clarification. I believe this is OK as-is due to sg3-utils not being installed in the bionic server image by default.
Diff comments:
> diff --git a/debian/patches/55-scsi-sg3_id.rules-ID_SERIAL-fix.patch b/debian/patches/55-scsi-sg3_id.rules-ID_SERIAL-fix.patch
> new file mode 100644
> index 0000000..7eddde3
> --- /dev/null
> +++ b/debian/patches/55-scsi-sg3_id.rules-ID_SERIAL-fix.patch
> @@ -0,0 +1,85 @@
> +Description: 55-scsi-sg3_id.rules: ID_SERIAL fix for USB SPC-only devices
> +
> +Upstream commit had changes for:
> +
> +git-svn-id: svn://localhost/trunk@703 6180dd3e-e324-4e3e-922d-17de1ae2f315
> +---
> + ChangeLog | 4 +++-
> + scripts/55-scsi-sg3_id.rules | 15 ++++++++----
> + scripts/rescan-scsi-bus.sh | 46 ++++++++++++++++++++----------------
> + 3 files changed, 38 insertions(+), 27 deletions(-)
> +
> +But, for this SRU, I'm backporting ONLY the changes in:
> +
> + 55-scsi-sg3_id.rules | 15 ++++++++++-----
> + 1 file changed, 10 insertions(+), 5 deletions(-)
> +
> +Because I'm only interested in the fix for USB SPC-only devices ID_SERIAL.
> +
> +This upstream commit changes the udev rules logic for USB block devices
> +that only supports SCSI PRIMARY COMMANDS, not supporting SCSI INQ 0x80
> +nor 0x83.
> +
> +Despite a possible delay, still existing in this version, whenever a
> +SPC-only block device (pendrive ?) is attached, this version fixes the
> +main issue for LP: 1833618, wrong ID_SERIAL for those devices.
> +
> +Udev rules from sg3-utils will, still, execute SCSI INQ 0X80 trying to use VPDs
> +from the kernel, and those will fail fast. Unfortunately, the subsequent SCSI
> +INQ 0x83 command, also trying to use VPDs from kernel, will take much longer
> +time (sometimes up to 1 minute) to fail when it sees there is no existing
> +vpd_pg83 file in sysfs and send an INQ to the USB block device, adding a delay
> +in the device attachment. This is not being addressed in this fix as this is
> +still present in upstream version.
> +
> +This last issue has to be addressed in a future sg3-utils-merge and
> +that is why is being documented here (when this patch will likely be
> +dropped).
So, it's not clear to me if there will be a second or replacement patch to address the delay.
Significant delay may end up being just as problematic as invalid ID_SERIAL values if the
device isn't available during the install.
That said, bionic installs won't see this problem since bionic images do not include
sg3-utils installed by default; where as disco and newer do include this in the
default image.
> +
> +Signed-off-by: Rafael David Tinoco <rafaeldtinoco at ubuntu.com>
> +
> +Author: Douglas Gilbert <dgilbert at interlog.com>
> +Origin: upstream, https://github.com/hreinecke/sg3_utils/commit/988e967513f
> +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1833618
> +Last-Update: 2019-10-09
> +---
> + scripts/55-scsi-sg3_id.rules | 15 ++++++++++-----
> + 1 file changed, 10 insertions(+), 5 deletions(-)
> +
> +diff --git a/scripts/55-scsi-sg3_id.rules b/scripts/55-scsi-sg3_id.rules
> +index e914a5d..8c7356b 100644
> +--- a/scripts/55-scsi-sg3_id.rules
> ++++ b/scripts/55-scsi-sg3_id.rules
> +@@ -7,7 +7,12 @@ SUBSYSTEM!="block", GOTO="sg3_utils_id_end"
> + # Import values for partitions
> + ENV{DEVTYPE}=="partition", IMPORT{parent}="SCSI_*", ENV{ID_SCSI}="1"
> + # SCSI INQUIRY values
> +-KERNEL=="sd*[!0-9]|sr*", IMPORT{program}="/usr/bin/sg_inq --export $tempnode", ENV{ID_SCSI}="1"
> ++# If the 'inquiry' sysfs attribute is present the kernel will already
> ++# have scanned for VPD pages, so if the vpd page attribute is not
> ++# present it is not supported (or deemed unsafe to access).
> ++# Hence we can skip the call to sg_inq and avoid I/O altogether.
> ++KERNEL=="sd*[!0-9]|sr*", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/inquiry --raw", ENV{ID_SCSI}="1", ENV{ID_SCSI_SN}="1", ENV{ID_SCSI_DI}="1"
> ++KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}!="1", IMPORT{program}="/usr/bin/sg_inq --export $tempnode", ENV{ID_SCSI}="1"
> + # scsi_id compat mappings
> + ENV{SCSI_VENDOR}=="?*", ENV{ID_VENDOR}="$env{SCSI_VENDOR}"
> + ENV{SCSI_VENDOR_ENC}=="?*", ENV{ID_VENDOR_ENC}="$env{SCSI_VENDOR_ENC}"
> +@@ -16,11 +21,11 @@ ENV{SCSI_MODEL_ENC}=="?*", ENV{ID_MODEL_ENC}="$env{SCSI_MODEL_ENC}"
> + ENV{SCSI_REVISION}=="?*", ENV{ID_REVISION}="$env{SCSI_REVISION}"
> + ENV{SCSI_TYPE}=="?*", ENV{ID_TYPE}="$env{SCSI_TYPE}"
> + # SCSI EVPD page 0x80 values
> +-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/vpd_pg80 --raw", ENV{ID_SCSI_SN}="1"
> +-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_SN}!="1", IMPORT{program}="/usr/bin/sg_inq --export --page=sn $tempnode", ENV{ID_SCSI_SN}="1"
> ++KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_SN}=="1", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/vpd_pg80 --raw"
> ++KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_SN}!="1", IMPORT{program}="/usr/bin/sg_inq --export --page=sn $tempnode"
> + # SCSI EVPD page 0x83 values
> +-KERNEL=="sd*[!0-9]", ENV{ID_SCSI}=="1", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/vpd_pg83 --raw", ENV{ID_SCSI_DI}="1"
> +-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_DI}!="1", IMPORT{program}="/usr/bin/sg_inq --export --page=di $tempnode", ENV{ID_SCSI_DI}="1"
> ++KERNEL=="sd*[!0-9]", ENV{ID_SCSI}=="1", ENV{ID_SCSI_DI}=="1", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/vpd_pg83 --raw"
> ++KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_DI}!="1", IMPORT{program}="/usr/bin/sg_inq --export --page=di $tempnode"
> +
> + # ID_WWN compat mapping
> + ENV{SCSI_IDENT_LUN_NAA_REGEXT}=="?*", ENV{ID_WWN}!="?*", ENV{ID_WWN}="0x$env{SCSI_IDENT_LUN_NAA_REGEXT}"
> +--
> +2.20.1
> +
--
https://code.launchpad.net/~rafaeldtinoco/ubuntu/+source/sg3-utils/+git/sg3-utils/+merge/373440
Your team Ubuntu Core Development Team is requested to review the proposed merge of ~rafaeldtinoco/ubuntu/+source/sg3-utils:lp1833618-bionic into ubuntu/+source/sg3-utils:ubuntu/bionic-devel.
More information about the Ubuntu-reviews
mailing list