From 52010908dbf85b6c30ffd761a4b1288df5d0e3c1 Mon Sep 17 00:00:00 2001 From: Zhiqiang Liu Date: Tue, 9 Feb 2021 14:15:31 +0800 Subject: [PATCH 1/5] sg3_utils: solve coredump problem, rename patches and set release to 2 for CI solve coredump problem, rename patches and set release to 2 for CI Signed-off-by: Zhiqiang Liu --- ....37-rescan-scsi-findremapped-enhance.patch | 0 ...0001-sg3_utils-1.37-rescan-downpress.patch | 0 ...02-bugfix-sg3_utils-fix-syntax-error.patch | 0 ...elete-lun-rescan-scsi-bus-report-err.patch | 0 0004-sg3_utils-fix-memset-coredump.patch | 29 +++++++++++++++++++ sg3_utils.spec | 14 +++++---- 6 files changed, 38 insertions(+), 5 deletions(-) rename 9000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch => 0000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch (100%) rename 9001-sg3_utils-1.37-rescan-downpress.patch => 0001-sg3_utils-1.37-rescan-downpress.patch (100%) rename 9002-bugfix-sg3_utils-fix-syntax-error.patch => 0002-bugfix-sg3_utils-fix-syntax-error.patch (100%) rename 9003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch => 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch (100%) create mode 100644 0004-sg3_utils-fix-memset-coredump.patch diff --git a/9000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch b/0000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch similarity index 100% rename from 9000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch rename to 0000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch diff --git a/9001-sg3_utils-1.37-rescan-downpress.patch b/0001-sg3_utils-1.37-rescan-downpress.patch similarity index 100% rename from 9001-sg3_utils-1.37-rescan-downpress.patch rename to 0001-sg3_utils-1.37-rescan-downpress.patch diff --git a/9002-bugfix-sg3_utils-fix-syntax-error.patch b/0002-bugfix-sg3_utils-fix-syntax-error.patch similarity index 100% rename from 9002-bugfix-sg3_utils-fix-syntax-error.patch rename to 0002-bugfix-sg3_utils-fix-syntax-error.patch diff --git a/9003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch b/0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch similarity index 100% rename from 9003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch rename to 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch diff --git a/0004-sg3_utils-fix-memset-coredump.patch b/0004-sg3_utils-fix-memset-coredump.patch new file mode 100644 index 0000000..ff6fdc5 --- /dev/null +++ b/0004-sg3_utils-fix-memset-coredump.patch @@ -0,0 +1,29 @@ +From dd2a61c9551ac5d2ac0c5902172fd8312edc22cb Mon Sep 17 00:00:00 2001 +From: yanglongkang +Date: Tue, 9 Feb 2021 11:39:32 +0800 +Subject: [PATCH] sg3_utils: fix memset coredump + +alloc MX_ALLOC_LEN size mem to enc_stat_rsp for +solving coredump problem. + +Signed-off-by: yanglongkang +--- + src/sg_ses.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/sg_ses.c b/src/sg_ses.c +index 23fc3b9..cf344b7 100644 +--- a/src/sg_ses.c ++++ b/src/sg_ses.c +@@ -5582,7 +5582,7 @@ main(int argc, char * argv[]) + enumerate_work(op); + goto early_out; + } +- enc_stat_rsp = sg_memalign(op->maxlen, 0, &free_enc_stat_rsp, false); ++ enc_stat_rsp = sg_memalign(MX_ALLOC_LEN, 0, &free_enc_stat_rsp, false); + if (NULL == enc_stat_rsp) { + pr2serr("Unable to get heap for enc_stat_rsp\n"); + goto err_out; +-- +1.8.3.1 + diff --git a/sg3_utils.spec b/sg3_utils.spec index 206d10a..d441e43 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -1,15 +1,16 @@ Name: sg3_utils Version: 1.45 -Release: 0 +Release: 2 Summary: Utilities that send SCSI commands to devices. License: GPL-2.0-or-later AND BSD URL: http://sg.danny.cz/sg/sg3_utils.html Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz -Patch9000: 9000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch -Patch9001: 9001-sg3_utils-1.37-rescan-downpress.patch -Patch9002: 9002-bugfix-sg3_utils-fix-syntax-error.patch -Patch9003: 9003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch +Patch0: 0000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch +Patch1: 0001-sg3_utils-1.37-rescan-downpress.patch +Patch2: 0002-bugfix-sg3_utils-fix-syntax-error.patch +Patch3: 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch +Patch4: 0004-sg3_utils-fix-memset-coredump.patch Provides: %{name}-libs Obsoletes: %{name}-libs @@ -70,6 +71,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la %{_mandir}/man8/* %changelog +* Tue Feb 9 2021 Zhiqiang Liu - 1.45-2 +- solve coredump problem, rename patches and set release to 2 for CI + * Fri Apr 17 2020 renxudong - 1.45-0 - Type:requirement - ID:NA -- Gitee From 264b76d5c4d5ffd82bb87b8d853dc195685f0e7d Mon Sep 17 00:00:00 2001 From: lixiaokeng Date: Wed, 4 Nov 2020 21:39:57 +0800 Subject: [PATCH 2/5] add make test --- sg3_utils.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sg3_utils.spec b/sg3_utils.spec index d441e43..059db28 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -1,6 +1,6 @@ Name: sg3_utils Version: 1.45 -Release: 2 +Release: 3 Summary: Utilities that send SCSI commands to devices. License: GPL-2.0-or-later AND BSD URL: http://sg.danny.cz/sg/sg3_utils.html @@ -48,6 +48,9 @@ This contains man files for the using of pciutils. make %{?_smp_mflags} +%check +make check + %install %make_install install -p -m 644 doc/rescan-scsi-bus.sh.8 $RPM_BUILD_ROOT%{_mandir}/man8 @@ -71,6 +74,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la %{_mandir}/man8/* %changelog +* Wed Nov 5 2020 lixiaokeng - 1.45-3 +- add make check + * Tue Feb 9 2021 Zhiqiang Liu - 1.45-2 - solve coredump problem, rename patches and set release to 2 for CI -- Gitee From ae2b3f054fa0671722b5ff2878e3485bb2499227 Mon Sep 17 00:00:00 2001 From: Wenchao Hao Date: Thu, 10 Dec 2020 09:32:55 +0800 Subject: [PATCH 3/5] Fix grammar problems in 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch Signed-off-by: Wenchao Hao --- ...utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch | 8 ++++---- sg3_utils.spec | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch b/0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch index 05375c1..d4adb6a 100644 --- a/0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch +++ b/0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch @@ -16,7 +16,7 @@ index 25a5f2a..dc3026a 100755 # If block directory exists && and PQUAL != 0, we unmapped lun0 and just have a well-known lun # If block directory doesn't exist && PQUAL == 0, we mapped a real lun0 - if [ "$lun" -eq 0 ] && [ $IPTYPE -eq 0 ] ; then -+ if [ "x$lun" -eq x0 ] && [ x$IPTYPE -eq 0 ] ; then ++ if [ x"$lun" = x0 ] && [ x$IPTYPE = x0 ] ; then if [ $RC = 2 ] ; then if [ -e "$devpath" ] ; then if [ -d "$devpath/block" ] ; then @@ -25,7 +25,7 @@ index 25a5f2a..dc3026a 100755 fi fi - elif [ $RC = 0 ] && [ $IPTYPE -eq 0 ] ; then -+ elif [ $RC = 0 ] && [ x$IPTYPE -eq x0 ] ; then ++ elif [ $RC = 0 ] && [ x$IPTYPE = x0 ] ; then if [ -e "$devpath" ] ; then if [ ! -d "$devpath/block" ] ; then remappedlun0=1 # Transition from well-known to real lun 0 @@ -34,7 +34,7 @@ index 25a5f2a..dc3026a 100755 # Special case: lun 0 just got added (for reportlunscan), # so make sure we correctly treat it as new - if [ "$lun" = "0" ] && [ "$1" = "1" ] && [ -z "$remappedlun0" ] ; then -+ if [ x"$lun" = x"0" ] && [ "$1" = "1" ] && [ -z "$remappedlun0" ] ; then ++ if [ x"$lun" = x"0" ] && [ x"$1" = x"1" ] && [ -z "$remappedlun0" ] ; then SCSISTR="" printf "\r\e[A\e[A\e[A" fi @@ -43,7 +43,7 @@ index 25a5f2a..dc3026a 100755 else echo "scsi remove-single-device $devnr" > /proc/scsi/scsi - if [ $RC -eq 1 ] || [ "$lun" -eq 0 ] ; then -+ if [ $RC -eq 1 ] || [ x"$lun" -eq x0 ] ; then ++ if [ $RC -eq 1 ] || [ x"$lun" = x0 ] ; then # Try readding, should fail if device is gone echo "scsi add-single-device $devnr" > /proc/scsi/scsi fi diff --git a/sg3_utils.spec b/sg3_utils.spec index 059db28..dd7f895 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -1,6 +1,6 @@ Name: sg3_utils Version: 1.45 -Release: 3 +Release: 4 Summary: Utilities that send SCSI commands to devices. License: GPL-2.0-or-later AND BSD URL: http://sg.danny.cz/sg/sg3_utils.html @@ -74,6 +74,10 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la %{_mandir}/man8/* %changelog +* Wed Nov 10 2020 haowenchao - 1.45-4 +- Fix grammar problems caused by patch + 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch + * Wed Nov 5 2020 lixiaokeng - 1.45-3 - add make check -- Gitee From 62a89763637c57fe1ef9ace50578e8a36ca040d7 Mon Sep 17 00:00:00 2001 From: chenyanpanHW Date: Sat, 31 Jul 2021 15:38:03 +0800 Subject: [PATCH 4/5] delete -Sgit from %autosetup, and delete BuildRequires git --- sg3_utils.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sg3_utils.spec b/sg3_utils.spec index dd7f895..0969c79 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -1,6 +1,6 @@ Name: sg3_utils Version: 1.45 -Release: 4 +Release: 5 Summary: Utilities that send SCSI commands to devices. License: GPL-2.0-or-later AND BSD URL: http://sg.danny.cz/sg/sg3_utils.html @@ -14,7 +14,7 @@ Patch4: 0004-sg3_utils-fix-memset-coredump.patch Provides: %{name}-libs Obsoletes: %{name}-libs -BuildRequires: gcc, git +BuildRequires: gcc %description The sg3_utils package contains utilities that send SCSI commands to devices. As well as @@ -39,7 +39,7 @@ Requires: man This contains man files for the using of pciutils. %prep -%autosetup -Sgit -n %{name}-%{version} +%autosetup -n %{name}-%{version} -p1 %build %configure --disable-static @@ -74,6 +74,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la %{_mandir}/man8/* %changelog +* Sat Jul 31 2021 chenyanpanHW - 1.45-5 +- DESC: delete -Sgit from %autosetup, and delete BuildRequires git + * Wed Nov 10 2020 haowenchao - 1.45-4 - Fix grammar problems caused by patch 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch -- Gitee From 24f68b351a9d63c8467d39c79eaeb61dabc1cc9d Mon Sep 17 00:00:00 2001 From: yanglongkang Date: Wed, 3 Nov 2021 09:06:02 +0800 Subject: [PATCH 5/5] sync each branch submit Signed-off-by: yanglongkang --- ...tils-1.42-delete-lun-rescan-scsi-bus-report-error.patch | 0 sg3_utils.spec | 7 +++++-- 2 files changed, 5 insertions(+), 2 deletions(-) rename 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch => 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch (100%) diff --git a/0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch b/0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch similarity index 100% rename from 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch rename to 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch diff --git a/sg3_utils.spec b/sg3_utils.spec index 0969c79..9ca0c5f 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -1,6 +1,6 @@ Name: sg3_utils Version: 1.45 -Release: 5 +Release: 6 Summary: Utilities that send SCSI commands to devices. License: GPL-2.0-or-later AND BSD URL: http://sg.danny.cz/sg/sg3_utils.html @@ -9,7 +9,7 @@ Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz Patch0: 0000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch Patch1: 0001-sg3_utils-1.37-rescan-downpress.patch Patch2: 0002-bugfix-sg3_utils-fix-syntax-error.patch -Patch3: 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch +Patch3: 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch Patch4: 0004-sg3_utils-fix-memset-coredump.patch Provides: %{name}-libs @@ -74,6 +74,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la %{_mandir}/man8/* %changelog +* Wed Nov 3 2021 yanglongkang - 1.45-6 +- sync each branch submit + * Sat Jul 31 2021 chenyanpanHW - 1.45-5 - DESC: delete -Sgit from %autosetup, and delete BuildRequires git -- Gitee