diff --git a/Makefile b/Makefile index 7640e6c0d..4d44a96b0 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,11 @@ VERSION := $(VERSION_WITHOUT_REVISION)$(REVISION) DEBIAN_REVISION=1.1 RPMTOPDIR ?= $(shell if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ else echo $$PWD/rpmbuilddir; fi) +SCST_SOURCE_FILES = $(shell if [ -e scripts/list-source-files ]; then \ + scripts/list-source-files; \ + else \ + echo scripts-source-files-is-missing; \ + fi) help: @echo " all : make all" @@ -309,8 +314,8 @@ make-scst-dist = \ scst-dist-gzip: scst-$(VERSION).tar.bz2 -scst-$(VERSION).tar.bz2: $(shell scripts/list-source-files) - $(call make-scst-dist,j,bz2,$(VERSION),grep -E '^doc/|^fcst/|^iscsi-scst/|^Makefile|^qla2x00t(|_git)/|^scripts/|^scst.spec|^scst/|^scst_local/|^srpt/|^usr/|^scstadmin/') +scst-$(VERSION).tar.bz2: $(SCST_SOURCE_FILES) + $(call make-scst-dist,j,bz2,$(VERSION),grep -E '^doc/|^fcst/|^iscsi-scst/|^Makefile|^qla2x00t(|-32gbit)/|^scripts/|^scst.spec|^scst/|^scst_local/|^srpt/|^usr/|^scstadmin/') scst-rpm: name=scst && \ @@ -363,12 +368,12 @@ debian/compat: sed 's/\..*//' >$@ ../scst_$(VERSION).orig.tar.gz: debian/changelog debian/compat Makefile \ - $(shell scripts/list-source-files) + $(SCST_SOURCE_FILES) $(call make-scst-dist,z,gz,$(VERSION),cat) && \ mv "scst-$(VERSION).tar.gz" "$@" ../scst_$(VERSION).orig.tar.xz: debian/changelog debian/compat Makefile \ - $(shell scripts/list-source-files) + $(SCST_SOURCE_FILES) $(call make-scst-dist,J,xz,$(VERSION),cat) && \ mv "scst-$(VERSION).tar.xz" "$@" diff --git a/debian/rules b/debian/rules index cd05b5aae..c473fc9c8 100755 --- a/debian/rules +++ b/debian/rules @@ -36,6 +36,7 @@ clean: -x debian/scst.postinst build: + [ -n "$(QLA_INI_DIR)" ] && \ make 2release && \ export BUILD_2X_MODULE=y && \ export CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y && \ diff --git a/debian/scst.dkms.in b/debian/scst.dkms.in index 615e76b63..cf863f55b 100644 --- a/debian/scst.dkms.in +++ b/debian/scst.dkms.in @@ -1,7 +1,7 @@ PACKAGE_VERSION="${PACKAGE_VERSION}" PACKAGE_NAME="scst" AUTOINSTALL=yes -MAKE[0]="export KVER=${kernelver} KDIR=${kernel_source_dir} BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y && make 2release && make -sC scst && make -sC fcst && make -sC iscsi-scst && make -sC qla2x00t/qla2x00-target && make -sC scst_local && make -sC srpt" +MAKE[0]="export KVER=${kernelver} KDIR=${kernel_source_dir} BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y && make 2release && make -sC scst && make -sC fcst && make -sC iscsi-scst && make -sC qla2x00t-32gbit/qla2x00-target && make -sC scst_local && make -sC srpt" CLEAN="make clean" # Remove any existing ib_srpt.ko kernel modules PRE_INSTALL="find /lib/modules/${kernelver} -name ib_srpt.ko -exec rm {} \;" @@ -21,7 +21,7 @@ BUILT_MODULE_NAME[3]="isert-scst" BUILT_MODULE_LOCATION[3]="iscsi-scst/kernel/isert-scst" DEST_MODULE_LOCATION[3]="/extra" BUILT_MODULE_NAME[4]="qla2x00tgt" -BUILT_MODULE_LOCATION[4]="qla2x00t/qla2x00-target" +BUILT_MODULE_LOCATION[4]="qla2x00t-32gbit/qla2x00-target" DEST_MODULE_LOCATION[4]="/extra" BUILT_MODULE_NAME[5]="qla2xxx_scst" BUILT_MODULE_LOCATION[5]="qla2x00t" diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 0c4f75c06..f27c7a7ae 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,36 +3,36 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -5.12.4 \ -5.11.20-nc \ -5.10.37-nc \ +5.12.12 \ +5.11.22-nc \ +5.10.45-nc \ 5.9.16-nc \ 5.8.18-nc \ 5.7.19-nc \ 5.6.19-nc \ 5.5.19-nc \ -5.4.119-nc \ +5.4.127-nc \ 5.3.18-nc \ 5.2.21-nc \ 5.1.21-nc \ 5.0.21-nc \ 4.20.17-nc \ -4.19.190-nc \ +4.19.195-nc \ 4.18.20-nc \ 4.17.19-nc \ 4.16.18-nc \ 4.15.18-nc \ -4.14.232-nc \ +4.14.237-nc \ 4.13.16-nc \ 4.12.14-nc \ 4.11.12-nc \ 4.10.17-nc \ -4.9.268-nc \ +4.9.273-nc \ 4.8.17-nc \ 4.7.10-nc \ 4.6.7-nc \ 4.5.7-nc \ -4.4.268-nc \ +4.4.273-nc \ 4.3.6-nc \ 4.2.8-nc \ 4.1.52-nc \ @@ -66,6 +66,7 @@ ABT_KERNELS=" \ 2.6.33.7-nc \ 2.6.32.27-nc \ 2.6.31.14-nc \ +4.18.0-305.3.1.el8^CentOS^8.4.2105-nc \ 4.18.0-240.15.1.el8_3^CentOS^8.3.2011-nc \ 4.18.0-193.28.1.el8_2^CentOS^8.2.2004-nc \ 4.18.0-147.8.1.el8_1^CentOS^8.1.1911-nc \ diff --git a/scripts/kernel-functions b/scripts/kernel-functions index 3a6a0d552..73769393e 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -119,9 +119,9 @@ function extract_kernel_tree { { extract_kernel_archive "$kver" && mv "linux-$kver" "linux-$1"; } || return $? fi - mv "linux-$1" ".." || return $? + mv "linux-$1" .. || return $? cd "../linux-$1" || return $? - ) + ) || return $? rmdir "${tmpdir}" } @@ -784,16 +784,14 @@ function download_and_extract_distro_rpm { CentOS) rpm2cpio "${kernel_downloads}/kernel-${kver}.src.rpm" | cpio -i --make-directories --quiet && - tar xaf "linux-${kver}.tar."* && - mv "linux-${kver}" ".." && - cd "../linux-${kver}" + tar xaf "linux-${kver}"*.tar.* && + mv "linux-${kver}"*[^z] "../linux-${kver}" ;; UEK) rpm2cpio "${kernel_downloads}/kernel-uek-${kver}.src.rpm" | cpio -i --make-directories --quiet && tar xaf "linux-${kver/-*}.tar."* && - mv "linux-${kver/-*}" "../linux-${kver}" && - cd "../linux-${kver}" + mv "linux-${kver/-*}" "../linux-${kver}" ;; *) echo "Error: unknown distro $distro" diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index 3520f1d55..f3a89cdbe 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -291,6 +291,7 @@ CONFIG_IRQSOFF_TRACER \ CONFIG_IWLWIFI_DEVICE_TRACING \ CONFIG_IWM_TRACING \ CONFIG_KALLMODSYMS \ +CONFIG_KCOV \ CONFIG_KVM_MMU_AUDIT \ CONFIG_MAC80211_DRIVER_API_TRACER \ CONFIG_MMIOTRACE \ @@ -678,11 +679,13 @@ do k="${kv}" generate_kernel_patch "$k" "${generate_kernel_patch_options}" || continue - ( + if ! ( cd "${outputdir}" && download_and_extract_kernel_tree "$k" - ) || + ); then + echo "Error: download_and_extract_kernel_tree $k failed" continue + fi k="${k/^*}" if [ "${run_checkpatch}" = "true" ]; then run_checkpatch "$k" diff --git a/scripts/specialize-patch b/scripts/specialize-patch index 49f51816a..b10dd5967 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -96,7 +96,8 @@ function evaluate(stmnt, pattern, arg, op, result) { "RHEL_RELEASE_CODE -0 < 7 * 256 + 5)", stmnt) gsub("IB_CLIENT_ADD_ONE_RETURNS_INT", - "(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))", stmnt) + "(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) || " \ + "RHEL_RELEASE_CODE -0 >= 8 * 256 + 4)", stmnt) gsub("defined\\(IB_CLIENT_REMOVE_TAKES_TWO_ARGS\\)", "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) || " \ @@ -165,7 +166,8 @@ function evaluate(stmnt, pattern, arg, op, result) { "RHEL_RELEASE_CODE -0 < 8 * 256 + 2)", stmnt) gsub("RDMA_REJECT_HAS_FOUR_ARGS", - "(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))", stmnt) + "(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) || " \ + "RHEL_RELEASE_CODE -0 >= 8 * 256 + 4)", stmnt) gsub("defined(ENABLE_NPIV)", 0, stmnt) diff --git a/scst-dkms.spec.in b/scst-dkms.spec.in index 1ed6bf987..a3cdb1304 100644 --- a/scst-dkms.spec.in +++ b/scst-dkms.spec.in @@ -132,7 +132,7 @@ space (scst_user). %build export KVER=%{kversion} PREFIX=%{_prefix} export BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y -for d in scst fcst iscsi-scst qla2x00t/qla2x00-target scst_local srpt; do +for d in scst fcst iscsi-scst qla2x00t-32gbit/qla2x00-target scst_local srpt; do %{make} -C $d done @@ -142,7 +142,7 @@ export BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y for d in scst; do DESTDIR=%{buildroot} %{make} -C $d install done -for d in fcst iscsi-scst qla2x00t/qla2x00-target scst_local srpt; do +for d in fcst iscsi-scst qla2x00t-32gbit/qla2x00-target scst_local srpt; do DESTDIR=%{buildroot} INSTALL_MOD_PATH=%{buildroot} %{make} -C $d install done rm -f %{buildroot}/lib/modules/%{kversion}/[Mm]odule* @@ -157,7 +157,7 @@ cat >%{buildroot}/usr/src/%{kmod_name}-%{dkms_version}/dkms.conf <<"EOF" PACKAGE_VERSION="%{dkms_version}" PACKAGE_NAME="%{kmod_name}" AUTOINSTALL=yes -MAKE[0]="export KVER=${kernelver} KDIR=${kernel_source_dir} BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y && make 2release && make -sC scst && make -sC fcst && make -sC iscsi-scst && make -sC qla2x00t/qla2x00-target && make -sC scst_local && make -sC srpt && cp */*.ko */*/*.ko *scst*/*/*/*.ko ." +MAKE[0]="export KVER=${kernelver} KDIR=${kernel_source_dir} BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y && make 2release && make -sC scst && make -sC fcst && make -sC iscsi-scst && make -sC qla2x00t-32gbit/qla2x00-target && make -sC scst_local && make -sC srpt && cp */*.ko */*/*.ko *scst*/*/*/*.ko ." CLEAN="make clean" # Remove any existing ib_srpt.ko kernel modules PRE_INSTALL="find /lib/modules/${kernelver} -name ib_srpt.ko -exec rm {} \;" diff --git a/scst/include/backport.h b/scst/include/backport.h index dfc6a0dae..a8850f665 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1863,11 +1863,16 @@ static inline struct kmem_cache *kmem_cache_create_usercopy(const char *name, /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0) +#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ + RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4 /* See also commit ba423fdaa589 ("net: add a new sockptr_t type") # v5.9 */ static inline void __user *KERNEL_SOCKPTR(void *p) { return (void __force __user *)p; } +#else +#define KERNEL_SOCKPTR(p) ((char __force __user *)p) +#endif #endif /* */ @@ -2031,7 +2036,9 @@ static inline void put_unaligned_be64(uint64_t i, void *p) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 7, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 7, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ + RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4) /* Only use get_unaligned_be24() if reading p - 1 is allowed. */ static inline uint32_t get_unaligned_be24(const uint8_t *const p) { @@ -2236,6 +2243,8 @@ fc_host_fpin_rcv(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf) * ELS requests"). */ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ + RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4) && \ !(defined(UEK_KABI_RENAME) && defined(FC_PORTSPEED_256GBIT)) #define ELS_RDP 0x18 #endif diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 36fda650a..4522c8fb3 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -486,7 +486,9 @@ static int vdisk_blockio_flush(struct block_device *bdev, gfp_t gfp_mask, res = blkdev_issue_flush(bdev, NULL); #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) res = blkdev_issue_flush(bdev, gfp_mask, NULL, BLKDEV_IFL_WAIT); -#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ + RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4) res = blkdev_issue_flush(bdev, gfp_mask, NULL); #elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) res = blkdev_issue_flush(bdev, gfp_mask);