From d1892df446dd9a7bf6ef7723616eb30725d57533 Mon Sep 17 00:00:00 2001 From: Zhiqiang Liu Date: Tue, 9 Feb 2021 14:15:31 +0800 Subject: [PATCH] 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