Skip to content

Commit

Permalink
Merge pull request #16 from truenas/NAS-125313
Browse files Browse the repository at this point in the history
NAS-125313 / 24.04 / TrueNAS DragonFish SCST fails to build with 6.6 kernel
  • Loading branch information
bmeagherix authored Nov 22, 2023
2 parents 34a44cd + 034f0a5 commit 379ece1
Show file tree
Hide file tree
Showing 74 changed files with 2,713 additions and 805 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/checkpatch_pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ jobs:
UNKNOWN_COMMIT_ID
NO_AUTHOR_SIGN_OFF
COMMIT_LOG_USE_LINK
BAD_REPORTED_BY_LINK
FILE_PATH_CHANGES
SPDX_LICENSE_TAG
LINUX_VERSION_CODE
CONSTANT_COMPARISON
NEW_TYPEDEFS
SPACING
)
ignore_str=${ignore[*]}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/checkpatch_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ jobs:
UNKNOWN_COMMIT_ID
NO_AUTHOR_SIGN_OFF
COMMIT_LOG_USE_LINK
BAD_REPORTED_BY_LINK
FILE_PATH_CHANGES
SPDX_LICENSE_TAG
LINUX_VERSION_CODE
CONSTANT_COMPARISON
NEW_TYPEDEFS
SPACING
)
ignore_str=${ignore[*]}
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions fcst/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -87,4 +90,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
6 changes: 5 additions & 1 deletion iscsi-scst/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -166,13 +168,15 @@ 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)"
if $(INFINIBAND_ENABLED); then \
(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
Expand Down
5 changes: 5 additions & 0 deletions iscsi-scst/README
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ Each target subdirectory contains the following entries:

- tid - TID of this target.

- alias - TargetAlias of this target. If not set, it will default to the
empty string and no TargetAlias will be reported in LOGIN RESPONSE or iSNS
for this target.

The "sessions" subdirectory contains the following attribute:

- thread_pid - the process identifiers (PIDs) of the iscsird and iscsiwr
Expand Down Expand Up @@ -559,6 +563,7 @@ both iSCSI-SCST targets will look like:
| | |-- NopInInterval
| | |-- QueuedCommands
| | |-- RspTimeout
| | |-- alias
| | |-- enabled
| | |-- ini_groups
| | | `-- mgmt
Expand Down
9 changes: 4 additions & 5 deletions iscsi-scst/kernel/conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,6 @@ int conn_activate(struct iscsi_conn *conn)

static int conn_setup_sock(struct iscsi_conn *conn)
{
int res = 0;
int opt = 1;
mm_segment_t oldfs;
struct iscsi_session *session = conn->session;
Expand All @@ -750,12 +749,13 @@ static int conn_setup_sock(struct iscsi_conn *conn)

conn->sock = SOCKET_I(file_inode(conn->file));

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)
if (conn->sock->ops->sendpage == NULL) {
PRINT_ERROR("Socket for sid %llx doesn't support sendpage()",
(unsigned long long)session->sid);
res = -EINVAL;
goto out;
return -EINVAL;
}
#endif

#if 0
conn->sock->sk->sk_allocation = GFP_NOIO;
Expand All @@ -768,8 +768,7 @@ static int conn_setup_sock(struct iscsi_conn *conn)
KERNEL_SOCKPTR(&opt), sizeof(opt));
set_fs(oldfs);

out:
return res;
return 0;
}

void iscsi_tcp_conn_free(struct iscsi_conn *conn)
Expand Down
2 changes: 1 addition & 1 deletion iscsi-scst/kernel/isert-scst/iser_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int isert_global_init(void)
spin_lock_init(&isert_glob.portal_lock);
init_waitqueue_head(&isert_glob.portal_wq);

isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", WQ_MEM_RECLAIM, 0);
isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", 0, 1);
if (!isert_glob.conn_wq) {
PRINT_ERROR("Failed to alloc iser conn work queue");
return -ENOMEM;
Expand Down
5 changes: 2 additions & 3 deletions iscsi-scst/kernel/isert-scst/iser_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
goto free_isert_dev;
}

isert_dev->cq_desc = vmalloc(sizeof(*isert_dev->cq_desc) *
isert_dev->num_cqs);
isert_dev->cq_desc = vmalloc_array(isert_dev->num_cqs, sizeof(*isert_dev->cq_desc));
if (unlikely(isert_dev->cq_desc == NULL)) {
PRINT_ERROR("Failed to allocate %zd bytes for iser cq_desc",
sizeof(*isert_dev->cq_desc) * isert_dev->num_cqs);
Expand Down Expand Up @@ -1793,7 +1792,7 @@ struct isert_portal *isert_portal_create(struct sockaddr *sa, size_t addr_len)
goto err_alloc;
}

portal->reinit_id_wq = alloc_ordered_workqueue("isert_reinit_id_wq", WQ_MEM_RECLAIM);
portal->reinit_id_wq = alloc_ordered_workqueue("isert_reinit_id_wq", 0);
if (unlikely(!portal->reinit_id_wq)) {
PRINT_ERROR("Unable to allocate reinit workqueue");
err = -ENOMEM;
Expand Down
Loading

0 comments on commit 379ece1

Please sign in to comment.