You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(19) |
Nov
(18) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(14) |
Feb
(14) |
Mar
(3) |
Apr
(10) |
May
(10) |
Jun
(17) |
Jul
(15) |
Aug
(24) |
Sep
(24) |
Oct
(11) |
Nov
(13) |
Dec
(15) |
2008 |
Jan
(10) |
Feb
(46) |
Mar
(20) |
Apr
(42) |
May
(44) |
Jun
(22) |
Jul
(59) |
Aug
(8) |
Sep
(15) |
Oct
(52) |
Nov
(30) |
Dec
(38) |
2009 |
Jan
(27) |
Feb
(27) |
Mar
(47) |
Apr
(85) |
May
(74) |
Jun
(41) |
Jul
(70) |
Aug
(64) |
Sep
(97) |
Oct
(147) |
Nov
(67) |
Dec
(48) |
2010 |
Jan
(68) |
Feb
(33) |
Mar
(53) |
Apr
(98) |
May
(55) |
Jun
(71) |
Jul
(99) |
Aug
(132) |
Sep
(291) |
Oct
(220) |
Nov
(344) |
Dec
(300) |
2011 |
Jan
(57) |
Feb
(25) |
Mar
(59) |
Apr
(104) |
May
(60) |
Jun
(155) |
Jul
(143) |
Aug
(43) |
Sep
(53) |
Oct
(20) |
Nov
(35) |
Dec
(103) |
2012 |
Jan
(62) |
Feb
(43) |
Mar
(29) |
Apr
(80) |
May
(75) |
Jun
(61) |
Jul
(52) |
Aug
(58) |
Sep
(33) |
Oct
(32) |
Nov
(69) |
Dec
(37) |
2013 |
Jan
(77) |
Feb
(28) |
Mar
(52) |
Apr
(18) |
May
(37) |
Jun
(21) |
Jul
(22) |
Aug
(55) |
Sep
(29) |
Oct
(74) |
Nov
(50) |
Dec
(44) |
2014 |
Jan
(77) |
Feb
(62) |
Mar
(81) |
Apr
(99) |
May
(59) |
Jun
(95) |
Jul
(55) |
Aug
(34) |
Sep
(78) |
Oct
(33) |
Nov
(48) |
Dec
(51) |
2015 |
Jan
(56) |
Feb
(120) |
Mar
(37) |
Apr
(15) |
May
(22) |
Jun
(196) |
Jul
(54) |
Aug
(33) |
Sep
(32) |
Oct
(42) |
Nov
(149) |
Dec
(61) |
2016 |
Jan
(15) |
Feb
(26) |
Mar
(37) |
Apr
(27) |
May
(14) |
Jun
(11) |
Jul
(13) |
Aug
(64) |
Sep
(2) |
Oct
(36) |
Nov
(18) |
Dec
(46) |
2017 |
Jan
(6) |
Feb
(1) |
Mar
(2) |
Apr
(50) |
May
(42) |
Jun
(11) |
Jul
(4) |
Aug
(12) |
Sep
(11) |
Oct
(21) |
Nov
(15) |
Dec
(42) |
2018 |
Jan
(33) |
Feb
(27) |
Mar
(20) |
Apr
(5) |
May
(4) |
Jun
(1) |
Jul
(42) |
Aug
(29) |
Sep
(11) |
Oct
(40) |
Nov
(312) |
Dec
(18) |
2019 |
Jan
(44) |
Feb
(98) |
Mar
(125) |
Apr
(160) |
May
(123) |
Jun
(33) |
Jul
(56) |
Aug
(81) |
Sep
(24) |
Oct
(23) |
Nov
(52) |
Dec
(86) |
2020 |
Jan
(6) |
Feb
(17) |
Mar
(62) |
Apr
(21) |
May
(118) |
Jun
(42) |
Jul
(52) |
Aug
(62) |
Sep
(20) |
Oct
(5) |
Nov
(23) |
Dec
(111) |
2021 |
Jan
(31) |
Feb
(8) |
Mar
(26) |
Apr
(13) |
May
(54) |
Jun
(31) |
Jul
(17) |
Aug
(10) |
Sep
(83) |
Oct
(8) |
Nov
(21) |
Dec
(33) |
2022 |
Jan
(67) |
Feb
(11) |
Mar
(4) |
Apr
(46) |
May
(12) |
Jun
(17) |
Jul
(19) |
Aug
(7) |
Sep
(53) |
Oct
(14) |
Nov
(29) |
Dec
(22) |
2023 |
Jan
(20) |
Feb
(4) |
Mar
(37) |
Apr
(25) |
May
(15) |
Jun
(20) |
Jul
(38) |
Aug
(1) |
Sep
(1) |
Oct
(34) |
Nov
|
Dec
(8) |
2024 |
Jan
(15) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(23) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
(18) |
Oct
(1) |
Nov
(18) |
Dec
(15) |
2025 |
Jan
(5) |
Feb
(1) |
Mar
(7) |
Apr
(4) |
May
(18) |
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gleb C. <lna...@ya...> - 2023-06-14 13:50:19
|
Commit: 6c2771b GitHub URL: https://github.com/SCST-project/scst/commit/6c2771baefc91d3a9219333b6bc994b8c6992bb4 Author: Gleb Chesnokov Date: 2023-06-14T16:49:36+03:00 Log Message: ----------- Makefile: Specify the installation directory for SCST modules explicitly This patch fixes the installation process for Linux kernels where the default value of INSTALL_MOD_DIR differs from `extra`. For instance, it unbreaks `make rpm` against Fedora's kernels, where INSTALL_MOD_DIR is set to `updates`. Modified Paths: -------------- fcst/Makefile | 5 ++++- iscsi-scst/Makefile | 6 +++++- qla2x00t-32gbit/Makefile | 5 ++++- qla2x00t-32gbit/qla2x00-target/Makefile | 5 ++++- qla2x00t/Makefile | 5 ++++- qla2x00t/qla2x00-target/Makefile | 5 ++++- scst/src/Makefile | 11 +++++++---- scst/src/dev_handlers/Makefile | 9 ++++++--- scst_local/Makefile | 5 ++++- srpt/Makefile | 5 ++++- 10 files changed, 46 insertions(+), 15 deletions(-) =================================================================== diff --git a/fcst/Makefile b/fcst/Makefile index 7c39044..497291b 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -55,7 +55,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SCST_DIR := $(shell echo "$$PWD")/../scst/src @@ -67,6 +69,7 @@ install: all KDIR=$(KDIR) ../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 557088e..f153e35 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -43,7 +43,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) INFINIBAND_ENABLED = $(shell syms=$$(dirname "$(KDIR)")/modules.symbols; if [ -e "$$syms" ] && grep -wq 'ib_register_client' "$$syms" || grep -q "^CONFIG_INFINIBAND=[my]$$" "$(KDIR)/.config"; then echo true; else echo false; fi) all: progs mods @@ -166,6 +168,7 @@ install: all (cd $(KMOD) && KDIR=$(KDIR) ../../scripts/sign-modules) $(MAKE) -C $(KDIR) M=$(KMOD) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)" @@ -173,6 +176,7 @@ install: all (cd $(ISERTMOD) && KDIR=$(KDIR) ../../../scripts/sign-modules);\ $(MAKE) -C $(KDIR) M=$(ISERTMOD) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install; \ fi diff --git a/qla2x00t-32gbit/Makefile b/qla2x00t-32gbit/Makefile index cf4cea8..48dad4f 100644 --- a/qla2x00t-32gbit/Makefile +++ b/qla2x00t-32gbit/Makefile @@ -45,7 +45,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) all: $(MAKE) -C $(KDIR) M=$(shell pwd) \ @@ -56,6 +58,7 @@ install: all KDIR=$(KDIR) ../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/qla2x00t-32gbit/qla2x00-target/Makefile b/qla2x00t-32gbit/qla2x00-target/Makefile index 574527e..4de10dc 100644 --- a/qla2x00t-32gbit/qla2x00-target/Makefile +++ b/qla2x00t-32gbit/qla2x00-target/Makefile @@ -62,7 +62,9 @@ ifndef PREFIX PREFIX=/usr/local endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SCST_DIR := $(shell echo "$$PWD/../../scst/src") @@ -77,6 +79,7 @@ endif KDIR=$(KDIR) ../../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index 9806a81..4bdb5fa 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -43,7 +43,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) all: $(MAKE) -C $(KDIR) M=$(shell pwd) \ @@ -54,6 +56,7 @@ install: all KDIR=$(KDIR) ../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index 0fe34e1..5fdfcf8 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -61,7 +61,9 @@ ifndef PREFIX PREFIX=/usr/local endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SCST_DIR := $(shell echo "$$PWD/../../scst/src") @@ -76,6 +78,7 @@ endif KDIR=$(KDIR) ../../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/scst/src/Makefile b/scst/src/Makefile index 9975a1f..a4469bf 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -61,8 +61,13 @@ ifeq ($(SCST_INC_DIR),) SCST_INC_DIR := ../include endif +INSTALL_MOD_DIR=extra + SCST_INTF_VER_FILE := $(SCST_INC_DIR)/scst_itf_ver.h +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) +INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst + $(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCST_INC_DIR)/scst_user.h echo "/* Autogenerated, don't edit */" >$(SCST_INTF_VER_FILE) echo "" >>$(SCST_INTF_VER_FILE) @@ -94,11 +99,12 @@ install: all KDIR=$(KDIR) ../../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ - INSTALL_MOD_DIR=extra/dev_handlers \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)/dev_handlers \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install install -d $(INSTALL_DIR_H) @@ -133,9 +139,6 @@ uninstall: -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) rm -rf $(INSTALL_DIR_H) -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra -INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst - clean: rm -f $(SCST_INTF_VER_FILE) $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) $@ diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 4ecbb5f..8d5734d 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -48,7 +48,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra/dev_handlers + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) all: $(MAKE) -C $(KDIR) M=$(shell pwd) \ @@ -63,12 +65,13 @@ install: all KDIR=$(KDIR) ../../../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install uninstall: - rm -f $(INSTALL_DIR)/dev_handlers/scst_*.ko - -rmdir $(INSTALL_DIR)/dev_handlers 2>/dev/null + rm -f $(INSTALL_DIR)/scst_*.ko + -rmdir $(INSTALL_DIR) 2>/dev/null clean: $(MAKE) -C $(KDIR) M=$(shell pwd) $@ diff --git a/scst_local/Makefile b/scst_local/Makefile index f53473c..05e2c4c 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -29,7 +29,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SCST_DIR := $(shell echo "$$PWD")/../scst/src @@ -41,6 +43,7 @@ install: all KDIR=$(KDIR) ../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/srpt/Makefile b/srpt/Makefile index 5f2a97a..86ba92f 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -31,7 +31,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SRC_FILES=$(wildcard */*.[ch]) @@ -125,6 +127,7 @@ install: all $(MAKE) -C $(KDIR) M=$(shell pwd)/src \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ CONFTEST_CFLAGS="$(CONFTEST_CFLAGS)" \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install |
From: Gleb C. <lna...@ya...> - 2023-06-14 13:50:10
|
Commit: 85e8086 GitHub URL: https://github.com/SCST-project/scst/commit/85e8086a7e49428666df6b139d53f1364a979b51 Author: Gleb Chesnokov Date: 2023-06-14T16:49:36+03:00 Log Message: ----------- Makefile: Implement several improvements to SCST Makefiles 1. Correct a typo, changing `make release` to `make 2release`. 2. Add information about package-related targets to the help section. 3. Remove `dev_handler` directory during the uninstall process. 4. Eliminate the non-existent `tgt` target from the PHONY targets. 5. Introduce SCST_MOD_DIR and SCST_DH_MOD_DIR as helper variables. Modified Paths: -------------- INSTALL.md | 2 +- Makefile | 7 +++++++ fcst/Makefile | 2 +- qla2x00t-32gbit/Makefile | 2 +- qla2x00t-32gbit/qla2x00-target/Makefile | 2 +- qla2x00t/Makefile | 2 +- qla2x00t/qla2x00-target/Makefile | 2 +- scst/src/Makefile | 15 +++++++++------ scst/src/dev_handlers/Makefile | 1 + scst_local/Makefile | 2 +- 10 files changed, 24 insertions(+), 13 deletions(-) =================================================================== diff --git a/INSTALL.md b/INSTALL.md index ce7c6b2..80c3472 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -22,7 +22,7 @@ If the following packages have not yet been installed, install these now: The next step is to build and install SCST. How to do that depends on whether or not your Linux distribution supports a package manager: - make release + make 2release if rpm -q glibc >/dev/null 2>&1; then rm -rf {,scstadmin/}rpmbuilddir make rpm diff --git a/Makefile b/Makefile index e81abe2..bdcca82 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,13 @@ help: @echo " usr_install : usr target: install" @echo " usr_uninstall : usr target: uninstall" @echo "" + @echo " scst-rpm : make SCST RPM packages" + @echo " scst-dkms-rpm : make SCST DKMS RPM packages" + @echo " rpm : make both SCST and scstadmin RPM packages" + @echo " rpm-dkms : make both SCST DKMS and scstadmin RPM packages" + @echo "" + @echo " dpkg : make SCST dpkg packages" + @echo "" @echo " 2perf : changes debug state to full performance" @echo " 2release : changes debug state to release" @echo " 2debug : changes debug state to full debug" diff --git a/fcst/Makefile b/fcst/Makefile index 8c82d4a..7c39044 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -87,4 +87,4 @@ extraclean: clean release-archive: ../scripts/generate-release-archive fcst "$$(sed -n 's/^#define[[:blank:]]FT_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' fcst.h)" -.PHONY: all tgt install uninstall clean extraclean release-archive +.PHONY: all install uninstall clean extraclean release-archive diff --git a/qla2x00t-32gbit/Makefile b/qla2x00t-32gbit/Makefile index ddcaafc..cf4cea8 100644 --- a/qla2x00t-32gbit/Makefile +++ b/qla2x00t-32gbit/Makefile @@ -71,7 +71,7 @@ clean: extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean +.PHONY: all install uninstall clean extraclean endif diff --git a/qla2x00t-32gbit/qla2x00-target/Makefile b/qla2x00t-32gbit/qla2x00-target/Makefile index 886494d..574527e 100644 --- a/qla2x00t-32gbit/qla2x00-target/Makefile +++ b/qla2x00t-32gbit/qla2x00-target/Makefile @@ -102,4 +102,4 @@ endif extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst +.PHONY: all install uninstall clean extraclean qla2xxx_scst diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index dfaa980..9806a81 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -69,7 +69,7 @@ clean: extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean +.PHONY: all install uninstall clean extraclean endif diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index b976e17..0fe34e1 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -101,4 +101,4 @@ endif extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst +.PHONY: all install uninstall clean extraclean qla2xxx_scst diff --git a/scst/src/Makefile b/scst/src/Makefile index 236d1d2..9975a1f 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -35,6 +35,9 @@ SHELL=/bin/bash DEV_HANDLERS_DIR = dev_handlers +SCST_MOD_DIR := $(shell pwd) +SCST_DH_MOD_DIR := $(shell pwd)/$(DEV_HANDLERS_DIR) + ifeq ($(KVER),) ifeq ($(KDIR),) KVER := $(shell uname -r) @@ -73,13 +76,13 @@ $(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCS all: $(SCST_INTF_VER_FILE) $(MAKE) -C certs KDIR=$(KDIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") - $(MAKE) -C $(KDIR) M=$(shell pwd) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") - $(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \ + $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") scst: - $(MAKE) -C $(KDIR) M=$(shell pwd) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") install: all @@ -89,12 +92,12 @@ install: all false; fi -rm -f $(INSTALL_DIR)/scsi_tgt.ko KDIR=$(KDIR) ../../scripts/sign-modules - $(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \ + $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ INSTALL_MOD_DIR=extra/dev_handlers \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install - $(MAKE) -C $(KDIR) M=$(shell pwd) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install @@ -135,7 +138,7 @@ INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst clean: rm -f $(SCST_INTF_VER_FILE) - $(MAKE) -C $(KDIR) M=$(shell pwd) $@ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) $@ $(MAKE) -C $(DEV_HANDLERS_DIR) $@ extraclean: clean diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 2be974b..4ecbb5f 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -68,6 +68,7 @@ install: all uninstall: rm -f $(INSTALL_DIR)/dev_handlers/scst_*.ko + -rmdir $(INSTALL_DIR)/dev_handlers 2>/dev/null clean: $(MAKE) -C $(KDIR) M=$(shell pwd) $@ diff --git a/scst_local/Makefile b/scst_local/Makefile index 4e7626f..f53473c 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -57,5 +57,5 @@ extraclean: clean release-archive: ../scripts/generate-release-archive scst_local "$$(sed -n 's/^#define[[:blank:]]SCST_LOCAL_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' scst_local.c)" -.PHONY: all tgt install uninstall clean extraclean +.PHONY: all install uninstall clean extraclean |
From: Gleb C. <lna...@ya...> - 2023-06-13 14:50:23
|
Commit: 3b0ab93 GitHub URL: https://github.com/SCST-project/scst/commit/3b0ab93c93b94d880f60fba76c8e9458cbf83ee1 Author: Gleb Chesnokov Date: 2023-06-13T17:49:50+03:00 Log Message: ----------- scst/include/backport.h: Unbreak the RHEL 9.3 build Fixes: https://github.com/SCST-project/scst/issues/167 Modified Paths: -------------- scst/include/backport.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 66671bc..6d0fd87 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -798,13 +798,15 @@ static inline void kvfree(void *addr) /* <linux/shrinker.h> */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 3)) /* * See also commit e33c267ab70d ("mm: shrinkers: provide shrinkers with * names") # v6.0. */ -static inline -int register_shrinker_backport(struct shrinker *shrinker, const char *fmt, ...) +static inline int +register_shrinker_backport(struct shrinker *shrinker, const char *fmt, ...) { /* * See also commit 1d3d4437eae1 ("vmscan: per-node deferred work") # v3.12 |
From: Gleb C. <lna...@ya...> - 2023-06-09 12:11:45
|
Commit: 1756a54 GitHub URL: https://github.com/SCST-project/scst/commit/1756a54367c3a46fa058618023f950abe0c6b7c9 Author: Gleb Chesnokov Date: 2023-06-09T15:11:18+03:00 Log Message: ----------- scst.spec.in, scst-dkms.spec.in: Unbreak the CentOS Stream 9 build Fixes: https://github.com/SCST-project/scst/issues/167 Modified Paths: -------------- scst-dkms.spec.in | 5 +++++ scst.spec.in | 5 +++++ 2 files changed, 10 insertions(+) =================================================================== diff --git a/scst-dkms.spec.in b/scst-dkms.spec.in index 848a3ea..ab43bb1 100644 --- a/scst-dkms.spec.in +++ b/scst-dkms.spec.in @@ -46,6 +46,10 @@ # Fedora %define kernel_devel_rpm kernel-devel %else +%if %([ %{kernel_rpm} = kernel-modules-core ]; echo $((1-$?))) +# CentOS Stream 9 +%define kernel_devel_rpm kernel-devel +%else %if %([ %{kernel_rpm} = kernel-uek-core ]; echo $((1-$?))) # UEK 7 %define kernel_devel_rpm kernel-uek-devel @@ -56,6 +60,7 @@ %endif %endif %endif +%endif %{echo:kernel_devel_rpm=%{kernel_devel_rpm} } %endif diff --git a/scst.spec.in b/scst.spec.in index b99bcb2..ba4f40d 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -51,6 +51,10 @@ # Fedora %define kernel_devel_rpm kernel-devel %else +%if %([ %{kernel_rpm} = kernel-modules-core ]; echo $((1-$?))) +# CentOS Stream 9 +%define kernel_devel_rpm kernel-devel +%else %if %([ %{kernel_rpm} = kernel-uek-core ]; echo $((1-$?))) # UEK 7 %define kernel_devel_rpm kernel-uek-devel @@ -61,6 +65,7 @@ %endif %endif %endif +%endif %{echo:kernel_devel_rpm=%{kernel_devel_rpm} } %endif |
From: Gleb C. <lna...@ya...> - 2023-06-05 10:53:08
|
Commit: e2a6774 GitHub URL: https://github.com/SCST-project/scst/commit/e2a6774a2e28c389a69a3525e9c653688fd31951 Author: Gleb Chesnokov Date: 2023-06-05T13:36:46+03:00 Log Message: ----------- scstadmin.spec: Replace custom Requires line with package names The scstadmin.spec.in file contained a custom Requires line that generated dependencies based on the full paths of the killall and rm commands. This approach is unconventional and could cause issues with dependency resolution. This patch replaces the custom Requires line with the package names providing the required commands, namely 'psmisc' for killall and 'coreutils' for rm. This change ensures proper dependency resolution and adheres to recommended practices for specifying dependencies in spec files. Fixes: https://github.com/SCST-project/scst/issues/152 Modified Paths: -------------- scstadmin/scstadmin.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/scstadmin/scstadmin.spec.in b/scstadmin/scstadmin.spec.in index 853c063..2016520 100644 --- a/scstadmin/scstadmin.spec.in +++ b/scstadmin/scstadmin.spec.in @@ -16,7 +16,7 @@ URL: http://scst.sourceforge.net/ Source: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build AutoReqProv: yes -Requires: %{expand:%%(for c in killall rm; do echo -n "$(which $c) "; done)} +Requires: psmisc, coreutils %description A tool for configuring SCST via the SCST sysfs interface. Allows to save, |
From: Gleb C. <lna...@ya...> - 2023-06-05 10:53:07
|
Commit: 1a4ecab GitHub URL: https://github.com/SCST-project/scst/commit/1a4ecab818f3d54b131655d5d604bc49d5648662 Author: Gleb Chesnokov Date: 2023-06-05T13:35:03+03:00 Log Message: ----------- qla2x00t-32gbit: Fix NULL pointer dereference in target mode When target mode is enabled, the pci_irq_get_affinity() function may return a NULL value in qla_mapq_init_qp_cpu_map() due to the qla24xx_enable_msix() code that handles IRQ settings for target mode. This leads to a crash due to a NULL pointer dereference. This patch fixes the issue by adding a check for the NULL value returned by pci_irq_get_affinity() and introducing a 'cpu_mapped' boolean flag to the qla_qpair structure, ensuring that the qpair's CPU affinity is updated when it has not been mapped to a CPU. Fixes: 1d201c81d4cc ("scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called") Signed-off-by: Gleb Chesnokov <gle...@sc...v> Link: https://lore.kernel.org/r/56b...@sc...v Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit d54820b22e40 upstream ] Fixes: https://github.com/SCST-project/scst/issues/156 Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 1 + qla2x00t-32gbit/qla_init.c | 9 +++------ qla2x00t-32gbit/qla_inline.h | 3 +++ qla2x00t-32gbit/qla_isr.c | 11 ++++------- 4 files changed, 11 insertions(+), 13 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index b403107..d4f7c4d 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -3848,6 +3848,7 @@ struct qla_qpair { uint64_t retry_term_jiff; struct qla_tgt_counters tgt_counters; uint16_t cpuid; + bool cpu_mapped; struct qla_fw_resources fwres ____cacheline_aligned; struct qla_buf_pool buf_pool; u32 cmd_cnt; diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index 8dc879c..b86f9af 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -9428,12 +9428,9 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos, qpair->req = ha->req_q_map[req_id]; qpair->rsp->req = qpair->req; qpair->rsp->qpair = qpair; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) && \ - (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 5)) - /* init qpair to this cpu. Will adjust at run time. */ - qla_cpu_update(qpair, raw_smp_processor_id()); -#endif + + if (!qpair->cpu_mapped) + qla_cpu_update(qpair, raw_smp_processor_id()); if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) { if (ha->fw_attributes & BIT_4) diff --git a/qla2x00t-32gbit/qla_inline.h b/qla2x00t-32gbit/qla_inline.h index c3f1b3b..b1bf22d 100644 --- a/qla2x00t-32gbit/qla_inline.h +++ b/qla2x00t-32gbit/qla_inline.h @@ -550,11 +550,14 @@ qla_mapq_init_qp_cpu_map(struct qla_hw_data *ha, if (!ha->qp_cpu_map) return; mask = pci_irq_get_affinity(ha->pdev, msix->vector_base0); + if (!mask) + return; qpair->cpuid = cpumask_first(mask); for_each_cpu(cpu, mask) { ha->qp_cpu_map[cpu] = qpair; } msix->cpuid = qpair->cpuid; + qpair->cpu_mapped = true; #endif } diff --git a/qla2x00t-32gbit/qla_isr.c b/qla2x00t-32gbit/qla_isr.c index 9a57920..646a4eb 100644 --- a/qla2x00t-32gbit/qla_isr.c +++ b/qla2x00t-32gbit/qla_isr.c @@ -3791,14 +3791,11 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, if (!ha->flags.fw_started) return; - if (rsp->qpair->cpuid != raw_smp_processor_id() || - !rsp->qpair->rcv_intr) { + if (rsp->qpair->cpuid != raw_smp_processor_id() || !rsp->qpair->rcv_intr) { rsp->qpair->rcv_intr = 1; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) && \ - (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 5)) - qla_cpu_update(rsp->qpair, raw_smp_processor_id()); -#endif + + if (!rsp->qpair->cpu_mapped) + qla_cpu_update(rsp->qpair, raw_smp_processor_id()); } #define __update_rsp_in(_is_shadow_hba, _rsp, _rsp_in) \ |
From: Gleb C. <lna...@ya...> - 2023-06-05 10:52:23
|
Commit: 7d1afe8 GitHub URL: https://github.com/SCST-project/scst/commit/7d1afe8a99206da5040d8d6496e6855852fe5553 Author: Gleb Chesnokov Date: 2023-06-05T13:35:03+03:00 Log Message: ----------- qla2x00t-32gbit: Drop redundant pci_enable_pcie_error_reporting() pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since commit f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas <bhe...@go...> Link: https://lore.kernel.org/r/202...@ke... Cc: Nilesh Javali <nj...@ma...> Cc: GR-...@ma... Signed-off-by: Martin K. Petersen <mar...@or...> [ commit c5c440bbff86 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 1 - qla2x00t-32gbit/qla_os.c | 6 ------ 2 files changed, 7 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index e25f8ea..437200a 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -22,7 +22,6 @@ #include <linux/interrupt.h> #include <linux/workqueue.h> #include <linux/firmware.h> -#include <linux/aer.h> #include <linux/mutex.h> #include <linux/btree.h> #include <linux/version.h> diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 4b4b19f..fc071df 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -3010,9 +3010,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ql2xallocfwdump = 0; } - /* This may fail but that's ok */ - pci_enable_pcie_error_reporting(pdev); - ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL); if (!ha) { ql_log_pci(ql_log_fatal, pdev, 0x0009, @@ -4022,8 +4019,6 @@ qla2x00_remove_one(struct pci_dev *pdev) pci_release_selected_regions(ha->pdev, ha->bars); kfree(ha); - pci_disable_pcie_error_reporting(pdev); - pci_disable_device(pdev); } @@ -6899,7 +6894,6 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work) qla2x00_unmap_iobases(ha); pci_release_selected_regions(ha->pdev, ha->bars); - pci_disable_pcie_error_reporting(pdev); pci_disable_device(pdev); /* |
From: Gleb C. <lna...@ya...> - 2023-06-05 10:47:48
|
Commit: 596800c GitHub URL: https://github.com/SCST-project/scst/commit/596800ce2d75ea9dd01e68c8a14b5baa0e6bd6e5 Author: Gleb Chesnokov Date: 2023-06-05T13:35:03+03:00 Log Message: ----------- qla2x00t-32gbit: Backport to older kernel versions Backport the change from a previous commit to kernel versions prior to v6.0, where commit f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native") hasn't been introduced. Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 6 ++++++ qla2x00t-32gbit/qla_os.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index 437200a..b403107 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -6,6 +6,9 @@ #ifndef __QLA_DEF_H #define __QLA_DEF_H +#ifndef INSIDE_KERNEL_TREE +#include <linux/version.h> +#endif #include <linux/kernel.h> #include <linux/init.h> #include <linux/types.h> @@ -22,6 +25,9 @@ #include <linux/interrupt.h> #include <linux/workqueue.h> #include <linux/firmware.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) +#include <linux/aer.h> +#endif #include <linux/mutex.h> #include <linux/btree.h> #include <linux/version.h> diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index fc071df..490568e 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -3010,6 +3010,11 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ql2xallocfwdump = 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + /* This may fail but that's ok */ + pci_enable_pcie_error_reporting(pdev); +#endif + ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL); if (!ha) { ql_log_pci(ql_log_fatal, pdev, 0x0009, @@ -4019,6 +4024,10 @@ qla2x00_remove_one(struct pci_dev *pdev) pci_release_selected_regions(ha->pdev, ha->bars); kfree(ha); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + pci_disable_pcie_error_reporting(pdev); +#endif + pci_disable_device(pdev); } @@ -6894,6 +6903,9 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work) qla2x00_unmap_iobases(ha); pci_release_selected_regions(ha->pdev, ha->bars); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + pci_disable_pcie_error_reporting(pdev); +#endif pci_disable_device(pdev); /* |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:43:03
|
Commit: 28e8d31 GitHub URL: https://github.com/SCST-project/scst/commit/28e8d31f86e4f4898457d25fedc63df82a1e7a3c Author: Gleb Chesnokov Date: 2023-05-10T13:39:06+03:00 Log Message: ----------- scst: Unbreak the RHEL 9.2 build See also PR https://github.com/SCST-project/scst/pull/145. Modified Paths: -------------- iscsi-scst/include/iscsi_scst.h | 10 +++++++++- qla2x00t-32gbit/qla_os.c | 8 +++++--- scst/src/dev_handlers/scst_vdisk.c | 8 ++++++-- scst/src/scst_lib.c | 12 ++++++++---- scst_local/scst_local.c | 8 ++++++-- 5 files changed, 34 insertions(+), 12 deletions(-) =================================================================== diff --git a/iscsi-scst/include/iscsi_scst.h b/iscsi-scst/include/iscsi_scst.h index 486c128..985621c 100644 --- a/iscsi-scst/include/iscsi_scst.h +++ b/iscsi-scst/include/iscsi_scst.h @@ -20,6 +20,12 @@ #include <linux/uaccess.h> /* mm_segment_t */ #include <linux/version.h> +#ifdef INSIDE_KERNEL_TREE +#include <scst/backport.h> +#else +#include "backport.h" +#endif + /* <asm/uaccess.h> */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) @@ -33,7 +39,9 @@ * to write kernel code that is compatible with all kernel versions. */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) || \ + (defined(RHEL_RELEASE_CODE) && \ + RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(9, 2)) /* * Backport mm_segment_t to save compatibility with older kernel versions. * diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 302ae70..16917bc 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -375,14 +375,16 @@ static void qla2x00_clear_drv_active(struct qla_hw_data *); static void qla2x00_free_device(scsi_qla_host_t *); #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) /* * See also commit a4e1d0b76e7b ("block: Change the return type of * blk_mq_map_queues() into void") # v6.1. */ -#define MAP_QUEUES_RET void -#else +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #define MAP_QUEUES_RET int +#else +#define MAP_QUEUES_RET void #endif static MAP_QUEUES_RET qla2xxx_map_queues(struct Scsi_Host *shost); diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 85a3931..54fbc70 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -3157,7 +3157,9 @@ struct bio_vec *vdisk_map_pages_to_bvec(struct bio_vec *bvec, struct page *page, } static void fileio_async_complete(struct kiocb *iocb, long ret -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) , long ret2 #endif ) @@ -3267,7 +3269,9 @@ static enum compl_status_e fileio_exec_async(struct vdisk_cmd_params *p) if (p->async.bvec != p->async.small_bvec) kfree(p->async.bvec); if (ret != -EIOCBQUEUED) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) fileio_async_complete(iocb, ret, 0); #else fileio_async_complete(iocb, ret); diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 29f1744..7adc568 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8560,14 +8560,16 @@ out: static void scsi_end_async(struct request *req, int error) #else -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) /* * See also commit de671d6116b5 ("block: change request end_io handler to pass * back a return value") # v6.1. */ -#define RQ_END_IO_RET enum rq_end_io_ret -#else +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #define RQ_END_IO_RET void +#else +#define RQ_END_IO_RET enum rq_end_io_ret #endif static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) @@ -8619,7 +8621,9 @@ static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) kmem_cache_free(scsi_io_context_cache, sioc); -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) && \ (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8) /* See also commit 92bc5a24844a ("block: remove __blk_put_request()") */ diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 1c168e2..e9a0390 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1462,8 +1462,12 @@ out: return ret; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) -/* See also commit fc7a6209d571 ("bus: Make remove callback return void") */ +/* + * See also commit fc7a6209d571 ("bus: Make remove callback return void") + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #define DRIVER_REMOVE_RET int #else #define DRIVER_REMOVE_RET void |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:42:50
|
Commit: b4e012c GitHub URL: https://github.com/SCST-project/scst/commit/b4e012ca423441782f4396d5299623a710258e5c Author: Gleb Chesnokov Date: 2023-05-10T13:39:06+03:00 Log Message: ----------- scst/include/backport.h: Fix the RHEL 9.0 build Commit 9be09fd68b46 ("scst/include/backport.h: Fix building on RHEL 8.8") fixed the build for RHEL 8.8, but at the same time, it broke the build for RHEL 9.0. Modified Paths: -------------- scst/include/backport.h | 42 ++++++++------- 1 file changed, 22 insertions(+), 20 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 2e154ce..c871706 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1464,10 +1464,8 @@ static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc, #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \ (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) - -#if (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7)) + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7) || \ + RHEL_RELEASE_CODE -0 == RHEL_RELEASE_VERSION(9, 0)) /* * See also 51f3a4788928 ("scsi: core: Introduce the scsi_cmd_to_rq() * function"). @@ -1478,27 +1476,18 @@ static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd) } #endif -/* - * See also commit c611529e7cd3 ("sd: Honor block layer integrity handling - * flags"; v3.18). - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) -static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd) -{ - /* To do: backport this function properly. */ - WARN_ON_ONCE(true); - return 512; -} -#endif - /* * See also commits 7ba46799d346 ("scsi: core: Add scsi_prot_ref_tag() * helper") and ddd0bc756983 ("block: move ref_tag calculation func to the * block layer"; v4.19). */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || \ - (defined(RHEL_RELEASE_CODE) && \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7))) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || \ + (defined(RHEL_RELEASE_CODE) && \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7)) static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) { #if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 7 @@ -1513,6 +1502,19 @@ static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) #endif #endif +/* + * See also commit c611529e7cd3 ("sd: Honor block layer integrity handling + * flags"; v3.18). + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) +static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd) +{ + /* To do: backport this function properly. */ + WARN_ON_ONCE(true); + return 512; +} +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \ (!defined(RHEL_RELEASE_CODE) || \ RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:42:40
|
Commit: 951e34f GitHub URL: https://github.com/SCST-project/scst/commit/951e34f5f8e2ed24d6981fa27a8c2b7d44379167 Author: Robert Blackhart Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst/include/backport.h: Fix building on RHEL 8.8 This fixes a compilation issue with RHEL 8.8 in scst/include/backport.h. This is the same issue as was seen for RHEL 8.7 in #77 Modified Paths: -------------- scst/include/backport.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 1e7e1cc..2e154ce 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1467,7 +1467,7 @@ static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc, RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) #if (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 != RHEL_RELEASE_VERSION(8, 7)) + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7)) /* * See also 51f3a4788928 ("scsi: core: Introduce the scsi_cmd_to_rq() * function"). @@ -1498,7 +1498,7 @@ static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd) */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || \ (defined(RHEL_RELEASE_CODE) && \ - RHEL_RELEASE_CODE -0 != RHEL_RELEASE_VERSION(8, 7))) + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7))) static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) { #if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 7 |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:42:29
|
Commit: 6485007 GitHub URL: https://github.com/SCST-project/scst/commit/648500799d9ccb9163bf906f1808d939e27ff5fc Author: Gleb Chesnokov Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst/include/backport.h: Fix the CentOS / RHEL 7.[012345] builds See also PR https://github.com/SCST-project/scst/pull/132. Modified Paths: -------------- scst/include/backport.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index dd98d9b..1e7e1cc 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -576,8 +576,9 @@ static inline long get_user_pages_backport(unsigned long start, /* <linux/kobject_ns.h> */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 6)) /* * See also commit 5f256becd868 ("[NET]: Basic network namespace * infrastructure."; v2.6.24). a685e08987d1 ("Delay struct net freeing while |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:42:15
|
Commit: 164a58f GitHub URL: https://github.com/SCST-project/scst/commit/164a58fa3d003514cb26674c74c33ce850288fb0 Author: Gleb Chesnokov Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst_lib: Fix bio_kmalloc usage for RHEL 9.1 See also commit 87340a8427d2 ("scst_lib: Fix bio_kmalloc usage to match change in Linux kernel v5.19"). Modified Paths: -------------- scst/src/scst_lib.c | 88 +++++++++------ 1 file changed, 56 insertions(+), 32 deletions(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 4e0f47b..29f1744 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -7938,6 +7938,8 @@ static void blk_free_kern_sg_work(struct blk_kern_sg_work *bw) return; } +static inline void scst_free_bio(struct bio *bio); + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) static void blk_bio_map_kern_endio(struct bio *bio, int err) { @@ -7968,16 +7970,7 @@ static void blk_bio_map_kern_endio(struct bio *bio) } } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) - /* - * See commit 066ff571011d ("block: turn bio_kmalloc into a simple - * kmalloc wrapper"). - */ - bio_uninit(bio); - kfree(bio); -#else - bio_put(bio); -#endif + scst_free_bio(bio); return; } @@ -8139,6 +8132,57 @@ scst_free_passthrough_request(struct request *rq) #endif } +/** + * scst_alloc_bio - Allocate a bio. + * @nr_vecs: Number of bio_vecs to allocate. + * @gfp_mask: The GFP_* mask given to the slab allocator. + * + * Returns + * Pointer to new bio on success, NULL on failure. + */ +static inline struct bio * +scst_alloc_bio(unsigned short nr_vecs, gfp_t gfp_mask) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) + return bio_kmalloc(gfp_mask, nr_vecs); +#else + /* + * See also commit 066ff571011d ("block: turn bio_kmalloc into a + * simple kmalloc wrapper"). + */ + struct bio *bio; + + bio = bio_kmalloc(nr_vecs, gfp_mask); + if (bio) + bio_init(bio, NULL, bio->bi_inline_vecs, nr_vecs, 0); + + return bio; +#endif +} + +/** + * scst_free_bio - Free a bio that was allocated with scst_alloc_bio(). + * @bio: bio pointer. + */ +static inline void +scst_free_bio(struct bio *bio) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) + bio_put(bio); +#else + /* + * See also commit 066ff571011d ("block: turn bio_kmalloc into a + * simple kmalloc wrapper"). + */ + bio_uninit(bio); + kfree(bio); +#endif +} + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) || \ (defined(CONFIG_SUSE_KERNEL) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) static struct request *blk_make_request(struct request_queue *q, @@ -8251,22 +8295,11 @@ static struct request *__blk_map_kern_sg(struct request_queue *q, int rc; if (need_new_bio) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) - /* - * See commit 066ff571011d ("block: turn - * bio_kmalloc into a simple kmalloc wrapper"). - */ - bio = bio_kmalloc(max_nr_vecs, gfp_mask); -#else - bio = bio_kmalloc(gfp_mask, max_nr_vecs); -#endif + bio = scst_alloc_bio(max_nr_vecs, gfp_mask); if (bio == NULL) { rq = ERR_PTR(-ENOMEM); goto out_free_bios; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) - bio_init(bio, NULL, bio->bi_inline_vecs, max_nr_vecs, 0); -#endif if (!reading) #if (!defined(CONFIG_SUSE_KERNEL) && \ @@ -8345,16 +8378,7 @@ out_free_bios: while (hbio != NULL) { bio = hbio; hbio = hbio->bi_next; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) - /* - * See commit 066ff571011d ("block: turn bio_kmalloc into a - * simple kmalloc wrapper"). - */ - bio_uninit(bio); - kfree(bio); -#else - bio_put(bio); -#endif + scst_free_bio(bio); } goto out; } |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:41:59
|
Commit: ae5aa8c GitHub URL: https://github.com/SCST-project/scst/commit/ae5aa8ca36b331b89961d60baf34b48b156c5cff Author: Brian Meagher Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst_lib: Fix bio_kmalloc usage to match change in Linux kernel v5.19 In kernel commit 066ff571011d ("block: turn bio_kmalloc into a simple kmalloc wrapper"), the order of arguments to bio_kmalloc changed, as did its semantics. Modified Paths: -------------- scst/src/scst_lib.c | 29 +++++++++++++++ 1 file changed, 29 insertions(+) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 559cd91..4e0f47b 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -7968,7 +7968,16 @@ static void blk_bio_map_kern_endio(struct bio *bio) } } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) + /* + * See commit 066ff571011d ("block: turn bio_kmalloc into a simple + * kmalloc wrapper"). + */ + bio_uninit(bio); + kfree(bio); +#else bio_put(bio); +#endif return; } @@ -8242,11 +8251,22 @@ static struct request *__blk_map_kern_sg(struct request_queue *q, int rc; if (need_new_bio) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) + /* + * See commit 066ff571011d ("block: turn + * bio_kmalloc into a simple kmalloc wrapper"). + */ + bio = bio_kmalloc(max_nr_vecs, gfp_mask); +#else bio = bio_kmalloc(gfp_mask, max_nr_vecs); +#endif if (bio == NULL) { rq = ERR_PTR(-ENOMEM); goto out_free_bios; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) + bio_init(bio, NULL, bio->bi_inline_vecs, max_nr_vecs, 0); +#endif if (!reading) #if (!defined(CONFIG_SUSE_KERNEL) && \ @@ -8325,7 +8345,16 @@ out_free_bios: while (hbio != NULL) { bio = hbio; hbio = hbio->bi_next; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) + /* + * See commit 066ff571011d ("block: turn bio_kmalloc into a + * simple kmalloc wrapper"). + */ + bio_uninit(bio); + kfree(bio); +#else bio_put(bio); +#endif } goto out; } |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:41:44
|
Commit: 5b9d4d0 GitHub URL: https://github.com/SCST-project/scst/commit/5b9d4d03d07dbd449371544d5d1f540a1eb22d10 Author: Brian Meagher Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst_lib: Fix sense data regression for pass-through commands. In kernel commit 772c8f6f3bbd ("Merge tag 'for-4.11/linus-merge-signed' * of git://git.kernel.dk/linux-block") both scsi_init_rq and scsi_init_request (later renamed to scsi_mq_init_request in e7008ff5c61a) initialize the scsi_request sense buffer, so we don't need to (nor should) provide our own. Modified Paths: -------------- scst/src/scst_lib.c | 26 ++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 178200a..559cd91 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -76,7 +76,17 @@ static void scst_free_acn(struct scst_acn *acn, bool reassign); struct scsi_io_context { void *data; void (*done)(void *data, char *sense, int result, int resid); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + /* + * See commit 772c8f6f3bbd ("Merge tag 'for-4.11/linus-merge-signed' + * of git://git.kernel.dk/linux-block") + * + * Both scsi_init_rq and scsi_init_request (later renamed to + * scsi_mq_init_request in e7008ff5c61a) initialize the scsi_request + * sense buffer, so we don't need to (nor should) provide our own. + */ char sense[SCST_SENSE_BUFFERSIZE]; +#endif }; static struct kmem_cache *scsi_io_context_cache; static struct workqueue_struct *scst_release_acg_wq; @@ -8530,6 +8540,7 @@ static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) if (sioc->done) { int resid_len; long result; + char *sense; #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) result = scsi_req(req)->result; @@ -8544,11 +8555,13 @@ static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) resid_len = scsi_req(req)->resid_len; + sense = SREQ_SENSE(scsi_req(req)); #else resid_len = req->resid_len; + sense = sioc->sense; #endif - sioc->done(sioc->data, sioc->sense, result, resid_len); + sioc->done(sioc->data, sense, result, resid_len); } kmem_cache_free(scsi_io_context_cache, sioc); @@ -8655,8 +8668,19 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data, memset(SREQ_CP(req), 0, MAX_COMMAND_SIZE); /* ATAPI hates garbage after CDB */ memcpy(SREQ_CP(req), cmd->cdb, cmd->cdb_len); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + /* + * See commit 772c8f6f3bbd ("Merge tag 'for-4.11/linus-merge-signed' + * of git://git.kernel.dk/linux-block") + * + * Both scsi_init_rq and scsi_init_request (later renamed to + * scsi_mq_init_request in e7008ff5c61a) initialize the scsi_request + * sense buffer, so we don't need to (nor should) provide our own. + */ SREQ_SENSE(req) = sioc->sense; req->sense_len = sizeof(sioc->sense); +#endif + rq->timeout = cmd->timeout; #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) req->retries = cmd->retries; |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:41:31
|
Commit: 2ec0fcc GitHub URL: https://github.com/SCST-project/scst/commit/2ec0fcc90330a89c51b15d5974609d4462be0beb Author: Gleb Chesnokov Date: 2023-05-10T13:34:15+03:00 Log Message: ----------- github: Add a job name for the mail notification action Enhance the mail notification GitHub action by including the commit message in the job name. Modified Paths: -------------- .github/workflows/mail_notification.yml | 1 + 1 file changed, 1 insertion(+) =================================================================== diff --git a/.github/workflows/mail_notification.yml b/.github/workflows/mail_notification.yml index e66ecc8..ee54d3b 100644 --- a/.github/workflows/mail_notification.yml +++ b/.github/workflows/mail_notification.yml @@ -9,6 +9,7 @@ on: jobs: send_mails: + name: ${{matrix.commit.message}} runs-on: ubuntu-latest strategy: max-parallel: 1 |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:41:20
|
Commit: f52cd09 GitHub URL: https://github.com/SCST-project/scst/commit/f52cd09e3a044b77a6472045f7c67e05bd971104 Author: Gleb Chesnokov Date: 2023-05-10T13:34:13+03:00 Log Message: ----------- github: Fix deprecated set-output commands set-output is being deprecated: "Starting 1st June 2023 workflows using save-state or set-output commands via stdout will fail with an error." So fix this by using the GITHUB_OUTPUT environment files instead. Modified Paths: -------------- .github/workflows/coverity.yml | 2 +- .github/workflows/mail_notification.yml | 38 +++++++-------- 2 files changed, 18 insertions(+), 22 deletions(-) =================================================================== diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 083ef0f..ebdc75f 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -19,7 +19,7 @@ jobs: revision="$(git rev-parse --short HEAD)" version="$version_without_revesion-$revision" - echo ::set-output name=version::"$version" + echo "version=$version" >> $GITHUB_OUTPUT - name: Run Coverity Build uses: vapier/coverity-scan-action@v1 diff --git a/.github/workflows/mail_notification.yml b/.github/workflows/mail_notification.yml index 36ff772..e66ecc8 100644 --- a/.github/workflows/mail_notification.yml +++ b/.github/workflows/mail_notification.yml @@ -24,40 +24,36 @@ jobs: - name: Get short ref id: get_short_ref run: | - echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} + echo "short_ref=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Get commit id - id: get_comm_id + id: get_commit_id run: | - echo ::set-output name=comm_id::$(git rev-parse --short HEAD) + echo "commit_id=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Get commit message - id: get_comm_message + id: get_commit_message run: | - echo ::set-output name=comm_message::$(git log --format=%s -n 1 HEAD) + echo "commit_message=$(git log --format=%s -n 1 HEAD)" >> $GITHUB_OUTPUT - name: Get list of files id: get_list_files run: | - files="$(git diff-tree --no-commit-id --stat --stat-name-width=60 --stat-graph-width=15 -r HEAD)" + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) - files="${files//'%'/'%25'}" - files="${files//$'\n'/'%0A'}" - files="${files//$'\r'/'%0D'}" - - echo ::set-output name=files::"$files" + echo "files<<$EOF" >> $GITHUB_OUTPUT + echo "$(git diff-tree --no-commit-id --stat --stat-name-width=60 --stat-graph-width=15 -r HEAD)" >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT - name: Get commit diff - id: get_comm_diff + id: get_commit_diff run: | if [ $(git show --no-patch --format="%P" | wc -w) -eq 1 ]; then - diff="$(git --no-pager diff -p HEAD^1)" - - diff="${diff//'%'/'%25'}" - diff="${diff//$'\n'/'%0A'}" - diff="${diff//$'\r'/'%0D'}" + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) - echo ::set-output name=comm_diff::"$diff" + echo "commit_diff<<$EOF" >> $GITHUB_OUTPUT + echo "$(git --no-pager diff -p HEAD^1)" >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT fi - name: Send mail @@ -73,7 +69,7 @@ jobs: password: ${{secrets.MAIL_SERVER_PASSWORD}} # Required mail subject: subject: | - [${{steps.get_short_ref.outputs.short_ref}}] ${{steps.get_comm_message.outputs.comm_message}} + [${{steps.get_short_ref.outputs.short_ref}}] ${{steps.get_commit_message.outputs.commit_message}} # Required recipients' addresses: to: scs...@li... # Required sender full name (address can be skipped): @@ -83,7 +79,7 @@ jobs: # Optional plain body: body: | - Commit: ${{steps.get_comm_id.outputs.comm_id}} + Commit: ${{steps.get_commit_id.outputs.commit_id}} GitHub URL: ${{matrix.commit.url}} Author: ${{matrix.commit.author.name}} Date: ${{matrix.commit.timestamp}} @@ -96,7 +92,7 @@ jobs: ${{steps.get_list_files.outputs.files}} =================================================================== - ${{steps.get_comm_diff.outputs.comm_diff}} + ${{steps.get_commit_diff.outputs.commit_diff}} # Optional unsigned/invalid certificates allowance: ignore_cert: true |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:41:01
|
Commit: 43ade90 GitHub URL: https://github.com/SCST-project/scst/commit/43ade9032969ab74d32a4c88ae6f74e2bd38b812 Author: Gleb Chesnokov Date: 2023-05-10T13:34:11+03:00 Log Message: ----------- github: Update actions/checkout to v3 This patch should fix the following github warning: Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2 Modified Paths: -------------- .github/workflows/ci.yml | 2 +- .github/workflows/coverity.yml | 2 +- .github/workflows/mail_notification.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) =================================================================== diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7853ae6..2d878d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: compiler: [gcc, clang] arch: [x86_64] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install build-essential run: | sudo apt-get update diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 9477cfd..083ef0f 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Project - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get version id: get_version diff --git a/.github/workflows/mail_notification.yml b/.github/workflows/mail_notification.yml index f795a6d..36ff772 100644 --- a/.github/workflows/mail_notification.yml +++ b/.github/workflows/mail_notification.yml @@ -16,7 +16,7 @@ jobs: commit: ${{github.event.commits}} steps: - name: Checkout Project - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{matrix.commit.id}} fetch-depth: 2 |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:40:48
|
Commit: dede178 GitHub URL: https://github.com/SCST-project/scst/commit/dede17895aa7b63032ea20abaf4727f88322c4ed Author: Gleb Chesnokov Date: 2023-05-10T13:34:06+03:00 Log Message: ----------- github: Update the version of SCST for the Coverity action Modified Paths: -------------- .github/workflows/coverity.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) =================================================================== diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 0fb12ae..9477cfd 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -15,7 +15,11 @@ jobs: - name: Get version id: get_version run: | - echo ::set-output name=version::"3.7-pre-$(git rev-parse --short HEAD)" + version_without_revesion="$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h)" + revision="$(git rev-parse --short HEAD)" + version="$version_without_revesion-$revision" + + echo ::set-output name=version::"$version" - name: Run Coverity Build uses: vapier/coverity-scan-action@v1 |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:25:21
|
Commit: 68461f5 GitHub URL: https://github.com/SCST-project/scst/commit/68461f5876d65d5d6817a68ce40b671a6aec8bb6 Author: Gleb Chesnokov Date: 2023-05-10T13:24:47+03:00 Log Message: ----------- scst: Remove support for RHEL5/6 The SCST has dropped support for RHEL5/6 since v3.6. Modified Paths: -------------- iscsi-scst/kernel/isert-scst/iser.h | 8 -------- scst/src/scst_lib.c | 4 ---- scst/src/scst_targ.c | 9 ++------- srpt/src/ib_srpt.h | 6 ------ 4 files changed, 2 insertions(+), 25 deletions(-) =================================================================== diff --git a/iscsi-scst/kernel/isert-scst/iser.h b/iscsi-scst/kernel/isert-scst/iser.h index c543c8b..6a08153 100644 --- a/iscsi-scst/kernel/isert-scst/iser.h +++ b/iscsi-scst/kernel/isert-scst/iser.h @@ -42,14 +42,6 @@ #ifndef INSIDE_KERNEL_TREE #include <linux/version.h> #endif - -#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 5 -static inline u16 vlan_dev_vlan_id(const void *dev) -{ - BUG(); - return 0; -} -#endif #include <rdma/rdma_cm.h> #include "iser_hdr.h" diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 722a3cb..976dcc4 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -3118,10 +3118,6 @@ int scst_get_cmd_abnormal_done_state(struct scst_cmd *cmd) PRINT_CRIT_ERROR("Wrong cmd state %d (cmd %p, op %s)", cmd->state, cmd, scst_get_opcode_name(cmd)); sBUG(); -#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 < 6 - /* Invalid state to suppress a compiler warning */ - res = SCST_CMD_STATE_LAST_ACTIVE; -#endif } if (trace) { diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 8667b3b..d696883 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -4726,14 +4726,9 @@ void scst_process_active_cmd(struct scst_cmd *cmd, bool atomic) break; default: - PRINT_CRIT_ERROR("cmd (%p) in state %d, but shouldn't " - "be", cmd, cmd->state); + PRINT_CRIT_ERROR("cmd (%p) in state %d, but shouldn't be", + cmd, cmd->state); sBUG(); -#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 < 6 - /* For suppressing a gcc compiler warning */ - res = SCST_CMD_STATE_RES_CONT_NEXT; - break; -#endif } } while (res == SCST_CMD_STATE_RES_CONT_SAME); diff --git a/srpt/src/ib_srpt.h b/srpt/src/ib_srpt.h index a52cc43..1eb2bde 100644 --- a/srpt/src/ib_srpt.h +++ b/srpt/src/ib_srpt.h @@ -48,12 +48,6 @@ #include <linux/version.h> #include <scst.h> #endif -#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 5 -#define vlan_dev_vlan_id(dev) (panic("RHEL 5 misses vlan_dev_vlan_id()"), 0) -#endif -#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 6 -#define __ethtool_get_settings(dev, cmd) (panic("RHEL misses __ethtool_get_settings()"), 0) -#endif #include <linux/rtnetlink.h> #include <rdma/rdma_cm.h> #include "ib_dm_mad.h" |
From: Gleb C. <lna...@ya...> - 2023-05-10 07:32:21
|
Commit: 92db6a9 GitHub URL: https://github.com/SCST-project/scst/commit/92db6a9fc58d55a0810499e273c796a97b04061b Author: Brian Meagher Date: 2023-05-10T10:31:51+03:00 Log Message: ----------- scst_pres,scst_dlm: Fix broken UNIT ATTENTION for remote PR registrants Previously, when scst_pr_send_ua_reg attempted to deliver a UNIT ATTENTION to a registrant that was on another node in a dlm-based HA cluster, the unit attention was dropped. Rectify by adding a pr_reg_queue_rem_ua function to struct scst_cl_ops and calling it from scst_pr_send_ua_reg. Each registrant will maintain an incoming 'queue' of unit attentions by adding next_rem_ua_idx to the registrant data maintained in the DLM. This will tell the other nodes which PR_REG_UA_LOCK lock to create in the lockspace in order to 'send' a unit attention to the registrant. Further, each node will also maintain two lists (pending and sent) for the outgoing unit attentions from this node to a registrant. When the recipient has read all the sent unit attentions (and cleared next_rem_ua_idx), then the sent list may be cleared. Modified Paths: -------------- scst/include/scst.h | 24 + scst/src/scst_dlm.c | 339 ++++++++++++++- scst/src/scst_dlm.h | 21 + scst/src/scst_no_dlm.c | 7 + scst/src/scst_pres.c | 4 +- scst/src/scst_pres.h | 3 + 6 files changed, 388 insertions(+), 10 deletions(-) =================================================================== diff --git a/scst/include/scst.h b/scst/include/scst.h index 0e9d299..0723d75 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -2637,6 +2637,26 @@ struct scst_dev_registrant { int dlm_idx; struct scst_lksb lksb; char lvb[PR_DLM_LVB_LEN]; + uint32_t registered_by_nodeid; + + /* List of UNIT ATTENTIONs to be sent by this node to this registrant on a remote node */ + struct list_head pending_rem_ua_list; + + /* + * List of UNIT ATTENTIONs already sent by this node to this registrant on a remote node + * + * Once the remote node clears next_rem_ua_idx, we can discard the entries. + */ + struct list_head sent_rem_ua_list; + + /* + * Index to indicate the tail of a 'queue' of incoming UNIT ATTENTIONs from remote nodes + * to this node, implemented as PR_REG_UA_LOCK locks. + * + * It will be incremented by the sender of each UA, and cleared by the recipiant node when + * it reads all the UNIT ATTENTIONs directed to it. + */ + uint16_t next_rem_ua_idx; }; /** @@ -2657,6 +2677,7 @@ struct scst_dev_registrant { * reservation on @dev. * @reserve: Apply an SPC-2 reservation for session @sess on @dev if * @sess != NULL or clear that reservation if @ses == NULL. + * @pr_reg_queue_rem_ua Queue a UNIT ATTENTION to a remote registrant. */ struct scst_cl_ops { int (*pr_init)(struct scst_device *dev, const char *cl_dev_id); @@ -2679,6 +2700,9 @@ struct scst_cl_ops { bool (*is_not_rsv_holder)(struct scst_device *dev, struct scst_session *sess); void (*reserve)(struct scst_device *dev, struct scst_session *sess); + void (*pr_reg_queue_rem_ua)(struct scst_device *dev, + struct scst_dev_registrant *reg, + int key, int asc, int ascq); }; /* diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index 109dc83..c3fb411 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -33,17 +33,48 @@ #if (defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE)) && \ !defined(CONFIG_SCST_NO_DLM) +/* + * UNIT ATTENTION that is to be delivered thru DLM to another (remote) node. + */ +struct scst_dlm_rem_ua { + int key; + int asc; + int ascq; + + struct scst_lksb lksb; + char lvb[PR_DLM_LVB_LEN]; + + /* + * Keep the list entry name generic as expect to reuse the struct + * definition in multiple contexts, e.g. pending_rem_ua_list and + * sent_rem_ua_list in struct scst_dev_registrant + */ + struct list_head rem_ua_list_entry; +}; + static void scst_pr_dlm_cleanup(struct scst_device *dev); static void scst_dlm_pre_bast(void *bastarg, int mode); static void scst_dlm_post_bast(void *bastarg, int mode); static void scst_dlm_post_ast(void *astarg); +static struct scst_dlm_rem_ua *scst_dlm_alloc_rem_ua(void); +static void scst_dlm_free_rem_ua(struct scst_dlm_rem_ua *ua); +static void scst_dlm_pr_reg_release_rem_ua(struct scst_dlm_rem_ua *ua); +static void scst_dlm_pr_reg_send_rem_ua(struct scst_device *dev, + dlm_lockspace_t *ls, + struct scst_dev_registrant *reg, + struct scst_dlm_rem_ua *ua); +static void scst_dlm_rm_rem_ua_ls(dlm_lockspace_t *ls, struct scst_dlm_rem_ua *ua); +static struct scst_dlm_rem_ua *scst_dlm_pr_reg_recv_rem_ua(struct scst_device *dev, + dlm_lockspace_t *ls, + struct scst_dev_registrant *reg, + int index); static inline void compile_time_size_checks(void) { BUILD_BUG_ON(sizeof(struct pr_lvb) > PR_DLM_LVB_LEN); BUILD_BUG_ON(sizeof(struct pr_lvb) != 20); BUILD_BUG_ON(sizeof(struct pr_reg_lvb) > PR_DLM_LVB_LEN); - BUILD_BUG_ON(sizeof(struct pr_reg_lvb) != 240); + BUILD_BUG_ON(sizeof(struct pr_reg_lvb) != 248); } static void scst_dlm_ast(void *astarg) @@ -157,13 +188,33 @@ static void scst_dlm_pr_init_reg(struct scst_device *dev, reg->lksb.lksb.sb_lvbptr = (void *)reg->lvb; reg->lksb.lksb.sb_lkid = 0; reg->dlm_idx = -1; + reg->registered_by_nodeid = -1; + INIT_LIST_HEAD(®->pending_rem_ua_list); + INIT_LIST_HEAD(®->sent_rem_ua_list); } static void scst_dlm_pr_rm_reg_ls(dlm_lockspace_t *ls, - struct scst_dev_registrant *reg) + struct scst_dev_registrant *reg, + bool include_rem_ua) { int res; + if (include_rem_ua) { + struct scst_dlm_rem_ua *ua, *tmp; + + /* Drop the items on the pending list */ + list_for_each_entry_safe(ua, tmp, ®->pending_rem_ua_list, rem_ua_list_entry) { + scst_dlm_pr_reg_release_rem_ua(ua); + } + reg->next_rem_ua_idx = 0; + + /* Drop the items on the sent list */ + list_for_each_entry_safe(ua, tmp, ®->sent_rem_ua_list, rem_ua_list_entry) { + scst_dlm_rm_rem_ua_ls(ls, ua); + scst_dlm_pr_reg_release_rem_ua(ua); + } + } + if (!reg->lksb.lksb.sb_lkid) return; res = scst_dlm_unlock_wait(ls, ®->lksb); @@ -178,7 +229,7 @@ static void scst_dlm_pr_rm_reg(struct scst_device *dev, struct scst_dev_registrant *reg) { lockdep_assert_pr_write_lock_held(dev); - scst_dlm_pr_rm_reg_ls(dev->pr_dlm->ls, reg); + scst_dlm_pr_rm_reg_ls(dev->pr_dlm->ls, reg, true); } /* Copy SPC-2 reservation state from the DLM LVB into @dev. */ @@ -306,7 +357,7 @@ static int scst_copy_from_dlm(struct scst_device *dev, dlm_lockspace_t *ls, list_for_each_entry(reg, &dev->dev_registrants_list, dev_registrants_list_entry) - scst_dlm_pr_rm_reg_ls(ls, reg); + scst_dlm_pr_rm_reg_ls(ls, reg, false); for (i = 0; i < nr_registrants; i++) { struct pr_reg_lvb *reg_lvb; @@ -330,10 +381,12 @@ static int scst_copy_from_dlm(struct scst_device *dev, dlm_lockspace_t *ls, rel_tgt_id, reg_lvb->key, false); if (reg) { - scst_dlm_pr_rm_reg_ls(ls, reg); + scst_dlm_pr_rm_reg_ls(ls, reg, false); reg->lksb.lksb.sb_lkid = reg_lksb[i].lksb.sb_lkid; reg->dlm_idx = i; - memcpy(reg->lvb, reg_lvb_content, sizeof(reg->lvb)); + reg->registered_by_nodeid = be32_to_cpu(reg_lvb->registered_by_nodeid); + reg->next_rem_ua_idx = be16_to_cpu(reg_lvb->next_rem_ua_idx); + memcpy(reg->lvb, reg_lvb, sizeof(reg->lvb)); if (reg_lvb->is_holder) { if (dev->pr_is_set) scst_pr_clear_holder(dev); @@ -346,6 +399,29 @@ static int scst_copy_from_dlm(struct scst_device *dev, dlm_lockspace_t *ls, scst_dlm_unlock_wait(ls, ®_lksb[i]); continue; } + + /* Does the registrant have UAs that need to be delivered here? */ + if (unlikely((reg->registered_by_nodeid == pr_dlm->local_nodeid) && + (reg->next_rem_ua_idx))) { + struct scst_dlm_rem_ua *ua; + int j; + + for (j = 0; j < reg->next_rem_ua_idx; j++) { + ua = scst_dlm_pr_reg_recv_rem_ua(dev, ls, reg, j); + if (ua) { + if (reg->tgt_dev) + scst_pr_send_ua_reg(dev, reg, ua->key, + ua->asc, ua->ascq); + scst_dlm_free_rem_ua(ua); + } + } + /* Reset the incoming queue and tell other nodes to re-read */ + reg->next_rem_ua_idx = 0; + reg_lvb->next_rem_ua_idx = cpu_to_be16(reg->next_rem_ua_idx); + memcpy(reg->lvb, reg_lvb, sizeof(reg->lvb)); + *modified_lvb = true; + } + scst_dlm_lock_wait(ls, DLM_LOCK_CR, ®->lksb, DLM_LKF_CONVERT | DLM_LKF_VALBLK, NULL, NULL); @@ -422,6 +498,7 @@ static void scst_copy_to_dlm(struct scst_device *dev, dlm_lockspace_t *ls) struct pr_lvb *lvb = (void *)pr_dlm->lvb; struct pr_reg_lvb *reg_lvb; struct scst_dev_registrant *reg; + struct scst_dlm_rem_ua *ua; int i; char reg_name[32]; uint32_t nr_registrants, tid_size; @@ -444,14 +521,17 @@ static void scst_copy_to_dlm(struct scst_device *dev, dlm_lockspace_t *ls) list_for_each_entry(reg, &dev->dev_registrants_list, dev_registrants_list_entry) { if (reg->dlm_idx >= nr_registrants) - scst_dlm_pr_rm_reg_ls(ls, reg); + scst_dlm_pr_rm_reg_ls(ls, reg, false); if (reg->dlm_idx < 0) { i = scst_get_available_dlm_idx(dev); snprintf(reg_name, sizeof(reg_name), PR_REG_LOCK, i); if (scst_dlm_lock_wait(ls, DLM_LOCK_NL, ®->lksb, 0, reg_name, NULL) - >= 0) + >= 0) { reg->dlm_idx = i; + reg->registered_by_nodeid = pr_dlm->local_nodeid; + reg->next_rem_ua_idx = 0; + } } } @@ -469,6 +549,8 @@ static void scst_copy_to_dlm(struct scst_device *dev, dlm_lockspace_t *ls) reg_lvb->rel_tgt_id = cpu_to_be16(reg->rel_tgt_id); reg_lvb->version = 1; reg_lvb->is_holder = dev->pr_holder == reg; + reg_lvb->registered_by_nodeid = cpu_to_be32(reg->registered_by_nodeid); + reg_lvb->next_rem_ua_idx = cpu_to_be16(reg->next_rem_ua_idx); tid_size = scst_tid_size(reg->transport_id); #if 0 PRINT_INFO("Copying transport ID into %s." PR_REG_LOCK @@ -482,6 +564,45 @@ static void scst_copy_to_dlm(struct scst_device *dev, dlm_lockspace_t *ls) sizeof(reg_lvb->tid))) tid_size = sizeof(reg_lvb->tid); memcpy(reg_lvb->tid, reg->transport_id, tid_size); + + /* + * If the destination has consumed all the UAs, then + * remove any that we sent and recorded. + */ + if (reg->next_rem_ua_idx == 0) { + while (!list_empty(®->sent_rem_ua_list)) { + ua = list_first_entry(®->sent_rem_ua_list, + struct scst_dlm_rem_ua, + rem_ua_list_entry); + scst_dlm_rm_rem_ua_ls(ls, ua); + scst_dlm_pr_reg_release_rem_ua(ua); + } + } + + /* + * Do we have UA's to deliver for this registrant? + * + * If so, generate a lock and keep a record of it. + */ + while (!list_empty(®->pending_rem_ua_list)) { + ua = list_first_entry(®->pending_rem_ua_list, + struct scst_dlm_rem_ua, rem_ua_list_entry); + + list_del_init(&ua->rem_ua_list_entry); + + /* + * Create new lock, add the entry to sent_rem_ua_list and increment + * next_rem_ua_idx. + */ + scst_dlm_pr_reg_send_rem_ua(dev, ls, reg, ua); + } + + /* + * We may have just increased next_rem_ua_idx in the above loop + * (scst_dlm_pr_reg_send_rem_ua) + */ + reg_lvb->next_rem_ua_idx = cpu_to_be16(reg->next_rem_ua_idx); + scst_dlm_lock_wait(ls, DLM_LOCK_CR, ®->lksb, DLM_LKF_CONVERT | DLM_LKF_VALBLK, reg_name, NULL); @@ -720,7 +841,7 @@ static void scst_dlm_remove_locks(struct scst_pr_dlm_data *pr_dlm, scst_pr_write_lock(dev); list_for_each_entry(reg, &dev->dev_registrants_list, dev_registrants_list_entry) - scst_dlm_pr_rm_reg_ls(ls, reg); + scst_dlm_pr_rm_reg_ls(ls, reg, true); scst_pr_write_unlock(dev); scst_dlm_remove_lock(ls, &pr_dlm->pre_join_lksb, NULL); @@ -1494,6 +1615,205 @@ static void scst_pr_dlm_cleanup(struct scst_device *dev) dev->pr_dlm = NULL; } +static struct scst_dlm_rem_ua *scst_dlm_alloc_rem_ua(void) +{ + struct scst_dlm_rem_ua *ua = NULL; + + ua = kzalloc(sizeof(struct scst_dlm_rem_ua), GFP_KERNEL); + if (ua == NULL) { + PRINT_ERROR("Unable to allocate unit attention"); + goto out; + } + + TRACE_MEM("Allocated dlm ua %p", ua); + + ua->lksb.lksb.sb_lvbptr = (void *)ua->lvb; + ua->lksb.lksb.sb_lkid = 0; + +out: + return ua; +} + +static void scst_dlm_free_rem_ua(struct scst_dlm_rem_ua *ua) +{ + TRACE_MEM("Freeing dlm ua %p", ua); + kfree(ua); +} + +/* + * scst_dlm_pr_reg_queue_rem_ua - queue a remote unit attention for transmition to the remote node + */ +static void scst_dlm_pr_reg_queue_rem_ua(struct scst_device *dev, + struct scst_dev_registrant *reg, + int key, int asc, int ascq) +{ + struct scst_dlm_rem_ua *ua = NULL; + struct scst_pr_dlm_data *const pr_dlm = dev->pr_dlm; + + TRACE_ENTRY(); + + ua = scst_dlm_alloc_rem_ua(); + if (ua == NULL) { + PRINT_ERROR("Unable to allocate unit attention for dlm registrant"); + return; + } + + ua->key = key; + ua->asc = asc; + ua->ascq = ascq; + + /* + * Lock to ensure we are not currently doing a scst_copy_to_dlm or + * scst_copy_from_dlm. + */ + mutex_lock(&pr_dlm->ls_mutex); + list_add_tail(&ua->rem_ua_list_entry, ®->pending_rem_ua_list); + mutex_unlock(&pr_dlm->ls_mutex); + + TRACE_EXIT(); +} + +/* + * scst_dlm_pr_reg_release_rem_ua - remove from list and free remote unit attention data structure + */ +static void scst_dlm_pr_reg_release_rem_ua(struct scst_dlm_rem_ua *ua) +{ + TRACE_ENTRY(); + + TRACE_DBG("Releasing dlm ua %p", ua); + list_del(&ua->rem_ua_list_entry); + scst_dlm_free_rem_ua(ua); + + TRACE_EXIT(); +} + +/* + * scst_dlm_pr_reg_send_rem_ua - send a unit attention to the registrant on a remote node + * + * This will create a lock containing the necessary UA information, increment next_rem_ua_idx and + * add the struct scst_dlm_rem_ua to the registrant's sent_rem_ua_list. + */ +static void scst_dlm_pr_reg_send_rem_ua(struct scst_device *dev, dlm_lockspace_t *ls, + struct scst_dev_registrant *reg, struct scst_dlm_rem_ua *ua) +{ + char reg_ua_name[32]; + struct dlm_ua_lvb *ua_lvb; + + TRACE_ENTRY(); + + snprintf(reg_ua_name, sizeof(reg_ua_name), PR_REG_UA_LOCK, reg->dlm_idx, + reg->next_rem_ua_idx); + + /* Always create a new lock. */ + if (scst_dlm_lock_wait(ls, DLM_LOCK_NL, &ua->lksb, 0, reg_ua_name, NULL) < 0) { + PRINT_ERROR("Failed to lock (NL) %s.%s", dev->virt_name, reg_ua_name); + goto out; + } + + if (scst_dlm_lock_wait(ls, DLM_LOCK_PW, &ua->lksb, + DLM_LKF_VALBLK | DLM_LKF_CONVERT, + reg_ua_name, NULL) < 0) { + PRINT_ERROR("Failed to lock %s.%s", dev->virt_name, reg_ua_name); + goto out; + } + + ua_lvb = (void *)ua->lksb.lksb.sb_lvbptr; + + memset(ua->lvb, 0, sizeof(ua->lvb)); + ua_lvb->version = 1; + ua_lvb->key = ua->key; + ua_lvb->asc = ua->asc; + ua_lvb->ascq = ua->ascq; + + scst_dlm_lock_wait(ls, DLM_LOCK_CR, &ua->lksb, + DLM_LKF_CONVERT | DLM_LKF_VALBLK, + reg_ua_name, NULL); + reg->next_rem_ua_idx++; + list_add_tail(&ua->rem_ua_list_entry, ®->sent_rem_ua_list); + +out: + TRACE_EXIT(); +} + +/* + * scst_dlm_rm_rem_ua_ls - Unlock the lock associated with a remote unit attention + */ +static void scst_dlm_rm_rem_ua_ls(dlm_lockspace_t *ls, struct scst_dlm_rem_ua *ua) +{ + int res; + + if (!ua->lksb.lksb.sb_lkid) + return; + res = scst_dlm_unlock_wait(ls, &ua->lksb); + WARN(res < 0, "scst_dlm_unlock_wait(%08x) failed (%d)", + ua->lksb.lksb.sb_lkid, res); + ua->lksb.lksb.sb_lkid = 0; +} + +/* + * scst_dlm_pr_reg_recv_rem_ua - receive a remotely generated UNIT ATTENTION for this registrant + * + * This will read unit attention that was 'published' by another node as a lock. The resultant + * struct scst_dlm_rem_ua will NOT be inserted into a list on this node. + */ +static struct scst_dlm_rem_ua *scst_dlm_pr_reg_recv_rem_ua(struct scst_device *dev, + dlm_lockspace_t *ls, + struct scst_dev_registrant *reg, + int index) +{ + char reg_ua_name[32]; + struct scst_dlm_rem_ua *ua; + struct dlm_ua_lvb *ua_lvb; + int res; + + ua = scst_dlm_alloc_rem_ua(); + if (!ua) + return NULL; + + ua_lvb = (void *)ua->lksb.lksb.sb_lvbptr; + snprintf(reg_ua_name, sizeof(reg_ua_name), PR_REG_UA_LOCK, reg->dlm_idx, index); + + res = scst_dlm_lock_wait(ls, DLM_LOCK_PW, &ua->lksb, + DLM_LKF_VALBLK, reg_ua_name, NULL); + if (res < 0) { + res = -EFAULT; + PRINT_ERROR("locking %s.%s failed", dev->virt_name, + reg_ua_name); + goto cancel; + } else if (ua->lksb.lksb.sb_flags & DLM_SBF_VALNOTVALID) { + res = -EINVAL; + PRINT_WARNING("%s.%s has an invalid lock value block", + dev->virt_name, reg_ua_name); + goto unlock_cancel; + } else if (ua_lvb->version != 1) { + res = -EPROTONOSUPPORT; + PRINT_ERROR("%s.%s.version = %d instead of 1", + dev->virt_name, reg_ua_name, + ua_lvb->version); + goto unlock_cancel; + } + + ua->key = ua_lvb->key; + ua->asc = ua_lvb->asc; + ua->ascq = ua_lvb->ascq; + + /* + * Now unlock again, we're done reading this from the DLM and have no + * further interest in this lock object. + */ + scst_dlm_rm_rem_ua_ls(ls, ua); + + return ua; + +unlock_cancel: + if (ua->lksb.lksb.sb_lkid) + scst_dlm_unlock_wait(ls, &ua->lksb); + +cancel: + scst_dlm_free_rem_ua(ua); + return NULL; +} + const struct scst_cl_ops scst_dlm_cl_ops = { .pr_init = scst_pr_dlm_init, .pr_cleanup = scst_pr_dlm_cleanup, @@ -1508,6 +1828,7 @@ const struct scst_cl_ops scst_dlm_cl_ops = { .is_rsv_holder = scst_dlm_is_rsv_holder, .is_not_rsv_holder = scst_dlm_is_not_rsv_holder, .reserve = scst_dlm_reserve, + .pr_reg_queue_rem_ua = scst_dlm_pr_reg_queue_rem_ua, }; char *scst_dlm_cluster_name; diff --git a/scst/src/scst_dlm.h b/scst/src/scst_dlm.h index 4d9a926..863d3e3 100644 --- a/scst/src/scst_dlm.h +++ b/scst/src/scst_dlm.h @@ -34,6 +34,7 @@ #define PR_PRE_UPDATE_LOCK "pr_pre_%d" #define PR_POST_UPDATE_LOCK "pr_post_%d" #define PR_REG_LOCK "pr_reg_%02d" +#define PR_REG_UA_LOCK "pr_reg_%02d_ua_%02d" /* * Data members needed for managing PR data via the DLM. @@ -142,6 +143,10 @@ struct pr_lvb { * @version: version of this structure * @is_holder: whether or not holding the reservation * @tid: transport ID - up to 228 bytes for iSCSI + * @registered_by_nodeid: Corosync node ID of the node holding that + * made the registration. + * @next_rem_ua_idx: Index to be used when publishing the next UA + * @pad: Ensure this struct is a multiple of 8 bytes */ struct pr_reg_lvb { __be64 key; @@ -149,6 +154,22 @@ struct pr_reg_lvb { u8 version; u8 is_holder; u8 tid[228]; + __be32 registered_by_nodeid; + __be16 next_rem_ua_idx; + u8 pad[2]; +}; + +/** + * struct dlm_ua_lvb - PR_REG_UA_LOCK LVB data format + * @key: sense key + * @asc: additional sense code + * @ascq: additional sense code qualifier + */ +struct dlm_ua_lvb { + u8 version; + u8 key; + u8 asc; + u8 ascq; }; #endif /* __SCST_PRES_DLM_H */ diff --git a/scst/src/scst_no_dlm.c b/scst/src/scst_no_dlm.c index 54f8bb2..d8dceec 100644 --- a/scst/src/scst_no_dlm.c +++ b/scst/src/scst_no_dlm.c @@ -101,6 +101,12 @@ static void scst_no_dlm_reserve(struct scst_device *dev, dev->reserved_by = sess; } +static void scst_no_dlm_pr_reg_queue_rem_ua(struct scst_device *dev, + struct scst_dev_registrant *reg, + int key, int asc, int ascq) +{ +} + const struct scst_cl_ops scst_no_dlm_cl_ops = { .pr_init = scst_no_dlm_pr_init, .pr_cleanup = scst_no_dlm_pr_cleanup, @@ -115,4 +121,5 @@ const struct scst_cl_ops scst_no_dlm_cl_ops = { .is_rsv_holder = scst_no_dlm_is_rsv_holder, .is_not_rsv_holder = scst_no_dlm_is_not_rsv_holder, .reserve = scst_no_dlm_reserve, + .pr_reg_queue_rem_ua = scst_no_dlm_pr_reg_queue_rem_ua, }; diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index ce86068..b9c330a 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -539,7 +539,7 @@ static void scst_pr_remove_registrants(struct scst_device *dev) } /* Must be called under dev_pr_mutex */ -static void scst_pr_send_ua_reg(struct scst_device *dev, +void scst_pr_send_ua_reg(struct scst_device *dev, struct scst_dev_registrant *reg, int key, int asc, int ascq) { @@ -558,6 +558,8 @@ static void scst_pr_send_ua_reg(struct scst_device *dev, if (reg->tgt_dev) scst_check_set_UA(reg->tgt_dev, ua, sizeof(ua), 0); + else + dev->cl_ops->pr_reg_queue_rem_ua(dev, reg, key, asc, ascq); TRACE_EXIT(); return; diff --git a/scst/src/scst_pres.h b/scst/src/scst_pres.h index 1ab2f6e..3d68dbf 100644 --- a/scst/src/scst_pres.h +++ b/scst/src/scst_pres.h @@ -142,6 +142,9 @@ struct scst_dev_registrant *scst_pr_add_registrant(struct scst_device *dev, bool dev_lock_locked); void scst_pr_remove_registrant(struct scst_device *dev, struct scst_dev_registrant *reg); +void scst_pr_send_ua_reg(struct scst_device *dev, + struct scst_dev_registrant *reg, + int key, int asc, int ascq); void scst_pr_set_holder(struct scst_device *dev, struct scst_dev_registrant *holder, uint8_t scope, uint8_t type); |
From: Gleb C. <lna...@ya...> - 2023-05-10 07:09:55
|
Commit: e34a4e0 GitHub URL: https://github.com/SCST-project/scst/commit/e34a4e0975dc3d7103175dab8045e6516bf8811e Author: Brian Meagher Date: 2023-05-10T10:09:18+03:00 Log Message: ----------- scsi-scstd: Check initiator name provided during login The iSCSI specification has rules wrt what constitutes a valid initiator name. Perform some checks and reject LOGINs with an invalid initiator name. Modified Paths: -------------- iscsi-scst/include/iscsi_scst.h | 1 + iscsi-scst/usr/iscsid.c | 291 +++++++++++++++ 2 files changed, 292 insertions(+) =================================================================== diff --git a/iscsi-scst/include/iscsi_scst.h b/iscsi-scst/include/iscsi_scst.h index 985621c..97f6301 100644 --- a/iscsi-scst/include/iscsi_scst.h +++ b/iscsi-scst/include/iscsi_scst.h @@ -70,6 +70,7 @@ static inline void set_fs(mm_segment_t seg) { } #include "iscsi_scst_itf_ver.h" /* The maximum length of 223 bytes in the RFC. */ +#define ISCSI_NAME_CHECK_LEN 223 /* Checked during LOGIN */ #define ISCSI_NAME_LEN 256 #define ISCSI_PORTAL_LEN 64 diff --git a/iscsi-scst/usr/iscsid.c b/iscsi-scst/usr/iscsid.c index a2f3de8..773fa50 100644 --- a/iscsi-scst/usr/iscsid.c +++ b/iscsi-scst/usr/iscsid.c @@ -498,6 +498,292 @@ out: return res; } +static bool valid_ascii_name_char(char ch) +{ + + /* + * From rtf3722 + * + * For those using only ASCII characters (U+0000 to U+007F), the + * following characters are allowed: + * + * - ASCII dash character ('-' = U+002d) + * - ASCII dot character ('.' = U+002e) + * - ASCII colon character (':' = U+003a) + * - ASCII lower-case characters ('a'..'z' = U+0061..U+007a) + * - ASCII digit characters ('0'..'9' = U+0030..U+0039) + */ + + if ((ch == '-') || (ch == '.') || (ch == ':') || + ((ch >= 'a') && (ch <= 'z')) || + ((ch >= '0') && (ch <= '9'))) + return true; + + log_error("Name contains invalid character: %c", ch); + return false; +} + +static bool valid_utf8_name_char(long ch) +{ + /* + * From rfc3722 6. Prohibited Output + * + * This profile specifies prohibiting using the following tables from + * [RFC3454]. Characters appearing within these tables MUST NOT be used + * within an iSCSI name. + * + * Table C.1.1 + * Table C.1.2 + * Table C.2.1 + * Table C.2.2 + * Table C.3 + * Table C.4 + * Table C.5 + * Table C.6 + * Table C.7 + * Table C.8 + * Table C.9 + */ + + /* C.1.1 ASCII space characters */ + if (ch == 0x0020) { + log_error("Invalid UTF-8: %lX (ASCII space characters)", ch); + return false; + } + + /* C.1.2 Non-ASCII space characters */ + switch (ch) { + case 0x00A0: /* NO-BREAK SPACE */ + case 0x1680: /* OGHAM SPACE MARK */ + case 0x2000: /* EN QUAD */ + case 0x2001: /* EM QUAD */ + case 0x2002: /* EN SPACE */ + case 0x2003: /* EM SPACE */ + case 0x2004: /* THREE-PER-EM SPACE */ + case 0x2005: /* FOUR-PER-EM SPACE */ + case 0x2006: /* SIX-PER-EM SPACE */ + case 0x2007: /* FIGURE SPACE */ + case 0x2008: /* PUNCTUATION SPACE */ + case 0x2009: /* THIN SPACE */ + case 0x200A: /* HAIR SPACE */ + case 0x200B: /* ZERO WIDTH SPACE */ + case 0x202F: /* NARROW NO-BREAK SPACE */ + case 0x205F: /* MEDIUM MATHEMATICAL SPACE */ + case 0x3000: /* IDEOGRAPHIC SPACE */ + log_error("Invalid UTF-8: %lX (Non-ASCII space characters)", ch); + return false; + } + + /* C.2.1 ASCII control characters */ + if ((ch >= 0x0000 && ch <= 0x001F) || /* CONTROL CHARACTERS */ + (ch == 0x007F)) { /* DELETE */ + log_error("Invalid UTF-8: %lX (ASCII control characters)", ch); + return false; + } + + /* C.2.2 Non-ASCII control characters */ + if ((ch >= 0x0080 && ch <= 0x009F) || /* CONTROL CHARACTERS */ + (ch == 0x06DD) || /* ARABIC END OF AYAH */ + (ch == 0x070F) || /* SYRIAC ABBREVIATION MARK */ + (ch == 0x180E) || /* MONGOLIAN VOWEL SEPARATOR */ + (ch == 0x200C) || /* ZERO WIDTH NON-JOINER */ + (ch == 0x200D) || /* ZERO WIDTH JOINER */ + (ch == 0x2028) || /* LINE SEPARATOR */ + (ch == 0x2029) || /* PARAGRAPH SEPARATOR */ + (ch == 0x2060) || /* WORD JOINER */ + (ch == 0x2061) || /* FUNCTION APPLICATION */ + (ch == 0x2062) || /* INVISIBLE TIMES */ + (ch == 0x2063) || /* INVISIBLE SEPARATOR */ + (ch >= 0x206A && (ch <= 0x206F)) || /* [CONTROL CHARACTERS] */ + (ch == 0xFEFF) || /* ZERO WIDTH NO-BREAK SPACE */ + (ch >= 0xFFF9 && ch <= 0xFFFC) || /* [CONTROL CHARACTERS] */ + (ch >= 0x1D173 && ch <= 0x1D17A)) { /* [MUSICAL CONTROL CHARACTERS] */ + log_error("Invalid UTF-8: %lX (Non-ASCII control characters)", ch); + return false; + } + + /* C.3 Private use */ + if ((ch >= 0xE000 && ch <= 0xF8FF) || /* [PRIVATE USE, PLANE 0] */ + (ch >= 0xF0000 && ch <= 0xFFFFD) || /* [PRIVATE USE, PLANE 15] */ + (ch >= 0x100000 && ch <= 0x10FFFD)) { /* [PRIVATE USE, PLANE 16] */ + log_error("Invalid UTF-8: %lX (Private use)", ch); + return false; + } + + /* C.4 Non-character code points */ + if ((ch >= 0xFDD0 && ch <= 0xFDEF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0xFFFE && ch <= 0xFFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x1FFFE && ch <= 0x1FFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x2FFFE && ch <= 0x2FFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x3FFFE && ch <= 0x3FFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x4FFFE && ch <= 0x4FFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x5FFFE && ch <= 0x5FFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x6FFFE && ch <= 0x6FFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x7FFFE && ch <= 0x7FFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x8FFFE && ch <= 0x8FFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x9FFFE && ch <= 0x9FFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0xAFFFE && ch <= 0xAFFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0xBFFFE && ch <= 0xBFFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0xCFFFE && ch <= 0xCFFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0xDFFFE && ch <= 0xDFFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0xEFFFE && ch <= 0xEFFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0xFFFFE && ch <= 0xFFFFF) || /* [NONCHARACTER CODE POINTS] */ + (ch >= 0x10FFFE && ch <= 0x10FFFF)) { /* [NONCHARACTER CODE POINTS] */ + log_error("Invalid UTF-8: %lX (Non-character code points)", ch); + return false; + } + + /* C.5 Surrogate codes */ + if (ch >= 0xD800 && ch <= 0xDFFF) { /* [SURROGATE CODES] */ + log_error("Invalid UTF-8: %lX (Surrogate codes)", ch); + return false; + } + + /* C.6 Inappropriate for plain text */ + if ((ch == 0xFFF9) || /* INTERLINEAR ANNOTATION ANCHOR */ + (ch == 0xFFFA) || /* INTERLINEAR ANNOTATION SEPARATOR */ + (ch == 0xFFFB) || /* INTERLINEAR ANNOTATION TERMINATOR */ + (ch == 0xFFFC) || /* OBJECT REPLACEMENT CHARACTER */ + (ch == 0xFFFD)) { /* REPLACEMENT CHARACTER */ + log_error("Invalid UTF-8: %lX (Inappropriate for plain text)", ch); + return false; + } + + /* C.7 Inappropriate for canonical representation */ + if (ch >= 0x2FF0 && ch <= 0x2FFB) { /* [IDEOGRAPHIC DESCRIPTION CHARACTERS] */ + log_error("Invalid UTF-8: %lX (Inappropriate for canonical representation)", ch); + return false; + } + + /* C.8 Change display properties or are deprecated */ + switch (ch) { + case 0x0340: /* COMBINING GRAVE TONE MARK */ + case 0x0341: /* COMBINING ACUTE TONE MARK */ + case 0x200E: /* LEFT-TO-RIGHT MARK */ + case 0x200F: /* RIGHT-TO-LEFT MARK */ + case 0x202A: /* LEFT-TO-RIGHT EMBEDDING */ + case 0x202B: /* RIGHT-TO-LEFT EMBEDDING */ + case 0x202C: /* POP DIRECTIONAL FORMATTING */ + case 0x202D: /* LEFT-TO-RIGHT OVERRIDE */ + case 0x202E: /* RIGHT-TO-LEFT OVERRIDE */ + case 0x206A: /* INHIBIT SYMMETRIC SWAPPING */ + case 0x206B: /* ACTIVATE SYMMETRIC SWAPPING */ + case 0x206C: /* INHIBIT ARABIC FORM SHAPING */ + case 0x206D: /* ACTIVATE ARABIC FORM SHAPING */ + case 0x206E: /* NATIONAL DIGIT SHAPES */ + case 0x206F: /* NOMINAL DIGIT SHAPES */ + log_error("Invalid UTF-8: %lX (Change display properties or are deprecated)", ch); + return false; + } + + /* C.9 Tagging characters */ + if ((ch == 0xE0001) || /* LANGUAGE TAG */ + (ch >= 0xE0020 && ch <= 0xE007F)) { /* [TAGGING CHARACTERS] */ + log_error("Invalid UTF-8: %lX (Tagging characters)", ch); + return false; + } + + return true; +} + +/* + * Checks whether the supplied name contains valid characters per RFC, returns true if so. + * + * It does NOT perform other formatting checks, e.g. that string starts with "iqn.", + * "naa." or "eui." ... along with subsequent formatting. + */ +static bool name_chars_are_valid(const char *name) +{ + const unsigned char *bytes = (const unsigned char *)name; + + if (!name) + return false; + + /* + * rfc7143 4.2.7.1. iSCSI Name Properties + * + * Initiators and targets MUST support the receipt of iSCSI names of up + * to the maximum length of 223 bytes. + */ + if (strlen(name) > ISCSI_NAME_CHECK_LEN) { + log_error("Name is too long: %s (%zu)", name, strlen(name)); + return false; + } + + /* + * Iterate over each character in the string, validating that it is + * an accepable character. This is complicated somewhat as UTF-8 + * encoding is supported. + * + * From rtf3629 + * Char. number range | UTF-8 octet sequence + * (hexadecimal) | (binary) + * --------------------+--------------------------------------------- + * 0000 0000-0000 007F | 0xxxxxxx + * 0000 0080-0000 07FF | 110xxxxx 10xxxxxx + * 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx + * 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + */ + while (*bytes) { + long code; + + if ((bytes[0] & 0x80) == 0x00) { + /* Regular ASCII */ + if (!valid_ascii_name_char(bytes[0])) + return false; + bytes += 1; + continue; + + } else if ((bytes[0] & 0xe0) == 0xc0) { + /* 110xxxxx 10xxxxxx */ + if ((bytes[1] & 0xc0) != 0x80) { + log_error("Invalid UTF-8: %02hhX %02hhX", bytes[0], bytes[1]); + return false; + } + code = ((long)(bytes[0] & 0x1f) << 6) | + ((long)(bytes[1] & 0x3f) << 0); + bytes += 2; + } else if ((bytes[0] & 0xf0) == 0xe0) { + /* 1110xxxx 10xxxxxx 10xxxxxx */ + if (((bytes[1] & 0xc0) != 0x80) || + ((bytes[2] & 0xc0) != 0x80)) { + log_error("Invalid UTF-8: %02hhX %02hhX %02hhX", + bytes[0], bytes[1], bytes[2]); + return false; + } + code = ((long)(bytes[0] & 0x0f) << 12) | + ((long)(bytes[1] & 0x3f) << 6) | + ((long)(bytes[2] & 0x3f) << 0); + bytes += 3; + } else if ((bytes[0] & 0xf8) == 0xf0 && (bytes[0] <= 0xf4)) { + /* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ + if (((bytes[1] & 0xc0) != 0x80) || + ((bytes[2] & 0xc0) != 0x80) || + ((bytes[3] & 0xc0) != 0x80)) { + log_error("Invalid UTF-8: %02hhX %02hhX %02hhX %02hhX", + bytes[0], bytes[1], bytes[2], bytes[3]); + return false; + } + code = ((long)(bytes[0] & 0x07) << 18) | + ((long)(bytes[1] & 0x3f) << 12) | + ((long)(bytes[2] & 0x3f) << 6) | + ((long)(bytes[3] & 0x3f) << 0); + bytes += 4; + } else { + log_error("Invalid UTF-8: %02hhX", bytes[0]); + return false; + } + + /* + * If we got here we have a valid UTF-8 character. Check it. + */ + if (!valid_utf8_name_char(code)) + return false; + } + + return true; +} + static void login_start(struct connection *conn) { struct iscsi_login_req_hdr *req = (struct iscsi_login_req_hdr *)&conn->req.bhs; @@ -512,6 +798,11 @@ static void login_start(struct connection *conn) return; } + if (!name_chars_are_valid(name)) { + login_rsp_ini_err(conn, ISCSI_STATUS_INIT_ERR); + return; + } + conn->initiator = strdup(name); if (conn->initiator == NULL) { log_error("Unable to duplicate initiator's name %s", name); |
From: Gleb C. <lna...@ya...> - 2023-05-02 20:14:44
|
Commit: 3dad1e9 GitHub URL: https://github.com/SCST-project/scst/commit/3dad1e957db0bd2b75efa645805579daa8fdbfbf Author: Gleb Chesnokov Date: 2023-05-02T23:14:06+03:00 Log Message: ----------- scst: Unbreak the build for kernel versions <= 6.3 The previous series of patches introduced the use of a const pointer to scsi_host_template. However, scsi_host_alloc() uses a non-const pointer prior to kernel version 6.4, causing the build to throw the following error: passing argument 1 of ‘scsi_host_alloc’ discards ‘const’ qualifier from pointer target type Hence, cast away the constness to resolve the error. Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 2 +- qla2x00t/qla_os.c | 2 +- scst_local/scst_local.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 50aa600..4b4b19f 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -5084,7 +5084,7 @@ struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *sht, struct Scsi_Host *host; struct scsi_qla_host *vha = NULL; - host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); + host = scsi_host_alloc((struct scsi_host_template *) sht, sizeof(scsi_qla_host_t)); if (!host) { ql_log_pci(ql_log_fatal, ha->pdev, 0x0107, "Failed to allocate host from the scsi layer, aborting.\n"); diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 2976b1b..4ffa2f6 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -3625,7 +3625,7 @@ struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *sht, struct Scsi_Host *host; struct scsi_qla_host *vha = NULL; - host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); + host = scsi_host_alloc((struct scsi_host_template *) sht, sizeof(scsi_qla_host_t)); if (host == NULL) { ql_log_pci(ql_log_fatal, ha->pdev, 0x0107, "Failed to allocate host from the scsi layer, aborting.\n"); diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 7577b98..742a05c 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1425,7 +1425,8 @@ static int scst_local_driver_probe(struct device *dev) TRACE_DBG("sess %p", sess); - hpnt = scsi_host_alloc(&scst_lcl_ini_driver_template, sizeof(*sess)); + hpnt = scsi_host_alloc((struct scsi_host_template *) &scst_lcl_ini_driver_template, + sizeof(*sess)); if (hpnt == NULL) { PRINT_ERROR("%s", "scsi_register() failed"); ret = -ENODEV; |
From: Gleb C. <lna...@ya...> - 2023-04-28 13:05:33
|
Commit: 15229d0 GitHub URL: https://github.com/SCST-project/scst/commit/15229d00cc5b765024daebd1a1a4373e73c020dc Author: Gleb Chesnokov Date: 2023-04-28T16:05:09+03:00 Log Message: ----------- github: Enhance checkpatch_pull error handling Add an error variable to track errors during the loop in checkpatch_pull.yml, allowing the workflow to run checkpatch for all commits before exiting with the appropriate status. Additionally, add COMMIT_LOG_USE_LINK to the ignore list for both pull and push workflows Modified Paths: -------------- .github/workflows/checkpatch_pull.yml | 7 ++++++- .github/workflows/checkpatch_push.yml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) =================================================================== diff --git a/.github/workflows/checkpatch_pull.yml b/.github/workflows/checkpatch_pull.yml index 3cb4eee..c231e64 100644 --- a/.github/workflows/checkpatch_pull.yml +++ b/.github/workflows/checkpatch_pull.yml @@ -29,6 +29,7 @@ jobs: EMAIL_SUBJECT UNKNOWN_COMMIT_ID NO_AUTHOR_SIGN_OFF + COMMIT_LOG_USE_LINK FILE_PATH_CHANGES SPDX_LICENSE_TAG LINUX_VERSION_CODE @@ -39,9 +40,13 @@ jobs: base_commit=${{github.event.pull_request.base.sha}} commits=$(git log --pretty=format:"%h" $base_commit..HEAD) + err=0 for commit in $commits; do echo "Running checkpatch.pl for commit $commit" - git format-patch -1 --stdout $commit | ./checkpatch.pl --no-tree --show-types --ignore="${ignore_str// /,}" - + echo "========================================" + git format-patch -1 --stdout $commit | ./checkpatch.pl --no-tree --show-types --ignore="${ignore_str// /,}" - || err=1 echo done + + exit $err diff --git a/.github/workflows/checkpatch_push.yml b/.github/workflows/checkpatch_push.yml index 98484cd..c5071f4 100644 --- a/.github/workflows/checkpatch_push.yml +++ b/.github/workflows/checkpatch_push.yml @@ -34,6 +34,7 @@ jobs: EMAIL_SUBJECT UNKNOWN_COMMIT_ID NO_AUTHOR_SIGN_OFF + COMMIT_LOG_USE_LINK FILE_PATH_CHANGES SPDX_LICENSE_TAG LINUX_VERSION_CODE |
From: Gleb C. <lna...@ya...> - 2023-04-28 12:24:35
|
Commit: 33dedb2 GitHub URL: https://github.com/SCST-project/scst/commit/33dedb2946140b28b422372796e5fa429f34e2b3 Author: Gleb Chesnokov Date: 2023-04-28T15:22:58+03:00 Log Message: ----------- scst_local: Declare SCSI host template const Make it explicit that the SCSI host template is not modified. Modified Paths: -------------- scst_local/scst_local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index bffe255..7577b98 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1375,7 +1375,7 @@ static struct scst_tgt_template scst_local_targ_tmpl = { #endif }; -static struct scsi_host_template scst_lcl_ini_driver_template = { +static const struct scsi_host_template scst_lcl_ini_driver_template = { .name = SCST_LOCAL_NAME, .queuecommand = scst_local_queuecommand, .change_queue_depth = scst_local_change_queue_depth, |