Merge ~lucaskanashiro/ubuntu/+source/sg3-utils:fix-rescan-scsi-bus-focal into ubuntu/+source/sg3-utils:ubuntu/focal-devel

Proposed by Lucas Kanashiro
Status: Rejected
Rejected by: Robie Basak
Proposed branch: ~lucaskanashiro/ubuntu/+source/sg3-utils:fix-rescan-scsi-bus-focal
Merge into: ubuntu/+source/sg3-utils:ubuntu/focal-devel
Diff against target: 59 lines (+38/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/0002-Fix-crash-with-rescan-scsi-bus.sh-r.patch (+30/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Andreas Hasenack Disapprove
Canonical Server Reporter Pending
Review via email: mp+450282@code.launchpad.net

Description of the change

Fix LP: #1976228. The package does not contain DEP-8 tests. The proposed changes are available in this PPA:

https://launchpad.net/~lucaskanashiro/+archive/ubuntu/rescan-scsi-bus-fix

To post a comment you must log in.
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

As elaborated in more detail in https://bugs.launchpad.net/ubuntu/+source/sg3-utils/+bug/1976228/comments/38, I don't think a focal fix is necessary, because sg_inq in focal returns the expected Device_type= information in its outout. Unless that depends on the running kernel (perhaps HWE changes things?). Actually, lemme check that real quick.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Yeah, with the hwe kernel (5.15.0-83) in focal, sg_inq still returns Device_type and not PDT, so rescan-scsi-bus.sh is not affected by the bug.

Unless I misread this completely, focal isn't affected.

review: Disapprove
Revision history for this message
Robie Basak (racb) wrote :

Andreas asked me to mark this as Rejected.

Unmerged commits

ddc84ed... by Lucas Kanashiro

changelog

c7652b0... by Lucas Kanashiro

  * d/p/0002-Fix-crash-with-rescan-scsi-bus.sh-r.patch: do not allow
    rescan-scsi-bus.sh to remove device (LP: #1976228).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 0a711ed..f9e372b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+sg3-utils (1.44-1ubuntu3) focal; urgency=medium
7+
8+ * d/p/0002-Fix-crash-with-rescan-scsi-bus.sh-r.patch: do not allow
9+ rescan-scsi-bus.sh to remove device (LP: #1976228).
10+
11+ -- Lucas Kanashiro <kanashiro@ubuntu.com> Wed, 22 Mar 2023 12:08:43 -0300
12+
13 sg3-utils (1.44-1ubuntu2) focal; urgency=medium
14
15 * Fix a typo in a udev rule that leads to truncated ID_SERIAL values in
16diff --git a/debian/patches/0002-Fix-crash-with-rescan-scsi-bus.sh-r.patch b/debian/patches/0002-Fix-crash-with-rescan-scsi-bus.sh-r.patch
17new file mode 100644
18index 0000000..fcbb63e
19--- /dev/null
20+++ b/debian/patches/0002-Fix-crash-with-rescan-scsi-bus.sh-r.patch
21@@ -0,0 +1,30 @@
22+From 80b570a1f890d2912418f7698213dfca40443fa1 Mon Sep 17 00:00:00 2001
23+From: "Nitin U. Yewale" <nyewale@redhat.com>
24+Date: Mon, 3 Jan 2022 13:12:12 +0530
25+Subject: [PATCH] fix crash with rescan-scsi-bus.sh -r
26+
27+---
28+ scripts/rescan-scsi-bus.sh | 6 ++++++
29+ 1 file changed, 6 insertions(+)
30+
31+Origin: backport, https://github.com/doug-gilbert/sg3_utils/pull/10
32+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/sg3-utils/+bug/1976228
33+Reviewed-By: Lucas Kanashiro <kanashiro@ubuntu.com>
34+Last-Update: 2023-08-30
35+
36+--- a/scripts/rescan-scsi-bus.sh
37++++ b/scripts/rescan-scsi-bus.sh
38+@@ -293,7 +293,13 @@
39+ IPREV=`echo "$INQ" | grep 'Product revision level:' | sed 's/^[^:]*: \(.*\)$/\1/'`
40+ STR=`printf " Vendor: %-08s Model: %-16s Rev: %-4s" "$IVEND" "$IPROD" "$IPREV"`
41+ IPTYPE=`echo "$INQ" | sed -n 's/.* Device_type=\([0-9]*\) .*/\1/p'`
42++ if [ -z "$IPTYPE" ]; then
43++ IPTYPE=$(echo "$INQ" | sed -n 's/.* PDT=\([0-9]*\) .*/\1/p')
44++ fi
45+ IPQUAL=`echo "$INQ" | sed -n 's/ *PQual=\([0-9]*\) Device.*/\1/p'`
46++ if [ -z "$IPQUAL" ] ; then
47++ IPQUAL=$(echo "$INQ" | sed -n 's/ *PQual=\([0-9]*\) PDT.*/\1/p')
48++ fi
49+ if [ "$IPQUAL" != 0 ] ; then
50+ [ -z "$IPQUAL" ] && IPQUAL=3
51+ [ -z "$IPTYPE" ] && IPTYPE=31
52diff --git a/debian/patches/series b/debian/patches/series
53index 0f8e6b5..4418e68 100644
54--- a/debian/patches/series
55+++ b/debian/patches/series
56@@ -1,2 +1,3 @@
57 fix-udevadm-path.patch
58 fix-SCSI_IDENT_LUN_NAA_EXT-udev-rule.patch
59+0002-Fix-crash-with-rescan-scsi-bus.sh-r.patch

Subscribers

People subscribed via source and target branches