Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase on upstream master #30

Merged
merged 37 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f4f8da8
scstadmin: Eliminate use of uninitialized value in numeric error
bmeagherix Jan 24, 2024
b1ec106
.github/workflows: Use the latest checkout action
bvanassche Feb 14, 2024
38b9e89
.github/workflows: Restrict some workflows to the official repository
bvanassche Feb 14, 2024
316856c
scst_lib: Remove documentation of removed arguments
bvanassche Feb 14, 2024
bee5066
scst_copy_mgr: Reject EXTENDED COPY(LID4) commands
bvanassche Feb 14, 2024
ff70c9d
scst_vdisk: Add active attributes support to vdisk_fileio
bmeagherix Feb 2, 2024
974001f
scst/include/backport.h, scst_vdisk: Port to Linux kernel v6.8
lnocturno Feb 16, 2024
bf6d418
qla2x00t-32gbit: Port to Linux kernel v6.8
lnocturno Feb 16, 2024
ce2ba13
scst_vdisk: Fix check for blockio device
lnocturno Feb 16, 2024
bb78492
scst_vdisk: Fix recent breakage in vdisk_exec_read_capacity16
bmeagherix Feb 22, 2024
7bec059
scst_vdisk: Simplify request_queue retrieval in vdisk_exec_read_capac…
lnocturno Feb 25, 2024
659c7a7
iscsi-scst: Add link_local parameter
bmeagherix Mar 20, 2024
12f9b6e
scst_lib, scst_vdisk: Port to Linux kernel v6.9
lnocturno Apr 22, 2024
6a21f45
iscsi-scst: Add mechanism to restore target parameter to default
bmeagherix Apr 26, 2024
f4840e9
nightly build: Update kernel versions
lnocturno Apr 26, 2024
56bb6c0
nightly build, scripts: Remove svn support
lnocturno Apr 26, 2024
d3a2fae
scripts/run-regression-tests: Explicitly set KBUILD_MODPOST_WARN=1
lnocturno May 2, 2024
71abad2
scst/include/backport.h: Fix backport for new stable kernels
lnocturno May 2, 2024
48ef509
scst/include/backport.h: Port to the latest UEK kernels
lnocturno May 2, 2024
52b5e84
scst/include/backport.h: Fix backport for new stable kernels
lnocturno May 3, 2024
8a1a7fa
scst/include/backport.h: Fix the build against UEK kernels
lnocturno May 3, 2024
1ea7200
qla2x00t-32gbit: use DEFINE_SHOW_STORE_ATTRIBUTE() helper for debugfs
lnocturno Apr 25, 2024
e322287
scst/include/backport.h: Backport DEFINE_SHOW_STORE_ATTRIBUTE()
lnocturno Apr 25, 2024
aabf1ce
qla2x00t-32gbit: Prevent command send on chip reset
lnocturno Apr 25, 2024
f91f314
qla2x00t-32gbit: Fix N2N stuck connection
lnocturno Apr 25, 2024
869135e
qla2x00t-32gbit: Split FCE|EFT trace control
lnocturno Apr 25, 2024
10c4006
qla2x00t-32gbit: Update manufacturer detail
lnocturno Apr 25, 2024
0929d81
qla2x00t-32gbit: NVME|FCP prefer flag not being honored
lnocturno Apr 25, 2024
5a325ea
qla2x00t-32gbit: Fix command flush on cable pull
lnocturno Apr 25, 2024
b0dd719
qla2x00t-32gbit: Fix double free of the ha->vp_map pointer
lnocturno Apr 25, 2024
f9329cc
qla2x00t-32gbit: Fix double free of fcport
lnocturno Apr 25, 2024
b7481e8
qla2x00t-32gbit: Change debug message during driver unload
lnocturno Apr 25, 2024
f8f70db
qla2x00t-32gbit: Delay I/O Abort on PCI error
lnocturno Apr 25, 2024
6c6f675
qla2x00t-32gbit: Update version to 10.02.09.200-k
lnocturno Apr 25, 2024
3e0408f
qla2x00t-32gbit: Fix off by one in qla_edif_app_getstats()
lnocturno Apr 25, 2024
3fba8e4
scst_lib: Allow REPORT LUNS to operate on an unsupported LUN
bmeagherix Feb 23, 2024
7c4e074
.github/workflows: Add a GitHub action to run regression tests upon push
lnocturno May 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checkpatch_pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@main
with:
ref: ${{github.event.pull_request.head.sha}}
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checkpatch_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
commit: ${{github.event.commits}}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@main
with:
ref: ${{matrix.commit.id}}
fetch-depth: 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
compiler: [gcc, clang]
arch: [x86_64]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@main
- name: Install build-essential
run: |
sudo apt-get update
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ on:

jobs:
coverity:
if: github.repository == 'SCST-project/scst'
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@main

- name: Get version
id: get_version
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mail_notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ on:
jobs:
send_mails:
name: ${{matrix.commit.message}}
if: github.repository == 'SCST-project/scst'
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
commit: ${{github.event.commits}}
steps:
- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@main
with:
ref: ${{matrix.commit.id}}
fetch-depth: 2
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/run_regression_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Regression tests upon push

on:
push:
branches:
- master

jobs:
regression_tests:
name: ${{matrix.version}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [
'6.8.7',
'6.7.12',
'6.6.28',
'6.1.87',
'5.15.156',
'5.10.215',
'5.4.274',
'4.19.312',
'4.14.336',
'4.9.337',
'3.18.140',
'3.10.108',
'5.14.0-284.30.1.el9_2^AlmaLinux^9.2',
'4.18.0-513.24.1.el8_9^AlmaLinux^8.9',
'4.18.0-477.13.1.el8_8^AlmaLinux^8.8',
'3.10.0-1160.108.1.el7^CentOS^7.9.2009',
'5.15.0-205.149.5.1.el9uek^UEK^9',
'5.4.17-2136.330.7.1.el8uek^UEK^8',
'5.4.17-2102.206.1.el7uek^UEK^7',
'4.1.12-124.48.6.el6uek^UEK^6'
]
steps:
- name: Checkout code
uses: actions/checkout@main

- name: Install libelf-dev
run: |
sudo apt-get install -y libelf-dev

- name: Install sparse
run: |
sudo apt-get install sparse

- name: Install smatch
run: |
git clone https://github.com/error27/smatch.git
cd smatch
make -j
sudo BINDIR=/bin SHAREDIR=/home/runner/share make install

- name: Run regression tests
run: |
err=0

./scripts/run-regression-tests -l -q -k -d /tmp/scst-${{matrix.version}} ${{matrix.version}}-nc-ns-nm | tee output.txt

cat output.txt | grep -A1 "Compiling the patched kernel" | grep -e "FAILED" -e "[^0] errors" > /dev/null 2>&1 && err=1

rm -f output.txt

exit $err
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
*.orig
*.sdtinfo.c
*.sdtstub.S
*.out
*~
.cache.mk
.cache/
.ctf
.depend_adm
.depend_d
Expand Down
4 changes: 4 additions & 0 deletions iscsi-scst/README
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ is /sys/kernel/scst_tgt/targets/iscsi. It has the following entries:
iSCSI-SCST attributes before it starts accepting new connections. 0
by default.

- link_local - if set, makes the response to an IPv6 SendTargets include
any link local addresses. Default is set.

- open_state - read-only attribute, which allows to see if the user
space part of iSCSI-SCST connected to the kernel part.

Expand Down Expand Up @@ -663,6 +666,7 @@ both iSCSI-SCST targets will look like:
| | | |-- reinstating
| | | `-- sid
| | `-- tid
| |-- link_local
| |-- mgmt
| |-- open_state
| |-- trace_level
Expand Down
27 changes: 27 additions & 0 deletions iscsi-scst/usr/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,16 @@ static int handle_e_get_attr_value(int fd, const struct iscsi_kern_event *event)
goto out_free;
}
snprintf(res_str, sizeof(res_str), "%s", isns_entity_target_name);
} else if (strcasecmp(ISCSI_LINK_LOCAL_ATTR_NAME, pp) == 0) {
if (target != NULL) {
log_error("Not NULL target %s for global attribute %s",
target->name, pp);
res = -EINVAL;
goto out_free;
}
snprintf(res_str, sizeof(res_str), "%d\n", send_targets_link_local);
if (send_targets_link_local != DEFAULT_SEND_TARGETS_LINK_LOCAL)
add_key_mark(res_str, sizeof(res_str), 0);
} else {
log_error("Unknown attribute %s", pp);
res = -EINVAL;
Expand Down Expand Up @@ -1067,6 +1077,23 @@ static int handle_e_set_attr_value(int fd, const struct iscsi_kern_event *event)
} else if (strcasecmp(ISCSI_ISNS_ENTITY_ATTR_NAME, pp) == 0) {
pp = config_sep_string(&p);
strlcpy(isns_entity_target_name, pp, sizeof(isns_entity_target_name));
} else if (strcasecmp(ISCSI_LINK_LOCAL_ATTR_NAME, pp) == 0) {
if (target != NULL) {
log_error("Not NULL target %s for global attribute %s",
target->name, pp);
res = -EINVAL;
goto out_free;
}
pp = config_sep_string(&p);
if (strcmp(pp, "1") == 0)
send_targets_link_local = 1;
else if (strcmp(pp, "0") == 0)
send_targets_link_local = 0;
else {
log_error("Unknown value %s", pp);
res = -EINVAL;
goto out_free;
}
} else {
log_error("Unknown attribute %s", pp);
res = -EINVAL;
Expand Down
3 changes: 3 additions & 0 deletions iscsi-scst/usr/iscsi_scstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,9 @@ int main(int argc, char **argv)
S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR, 0);
if (err != 0)
exit(err);
err = kernel_attr_add(NULL, ISCSI_LINK_LOCAL_ATTR_NAME, 0644, 0);
if (err != 0)
exit(err);

if ((ipc_fd = iscsi_adm_request_listen()) < 0) {
perror("Opening AF_LOCAL socket failed");
Expand Down
2 changes: 2 additions & 0 deletions iscsi-scst/usr/iscsid.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ extern void session_free(struct session *session);
extern struct connection *conn_find(struct session *session, u16 cid);

/* target.c */
#define DEFAULT_SEND_TARGETS_LINK_LOCAL 1
extern int send_targets_link_local;
extern struct __qelem targets_list;
extern int target_create(const char *name, struct target **out_target);
extern void target_free(struct target *target);
Expand Down
5 changes: 4 additions & 1 deletion iscsi-scst/usr/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ int params_val_to_str(const struct iscsi_key *keys, int idx, unsigned int val,
int params_str_to_val(const struct iscsi_key *keys, int idx, const char *str,
unsigned int *val)
{
if (keys[idx].ops->str_to_val)
if (!strcmp(":default:", str)) {
*val = keys[idx].local_def;
return 0;
} else if (keys[idx].ops->str_to_val)
return keys[idx].ops->str_to_val(str, val);
else
return 0;
Expand Down
1 change: 1 addition & 0 deletions iscsi-scst/usr/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define ISCSI_TARGET_REDIRECTION_VALUE_TEMP "temp"
#define ISCSI_TARGET_REDIRECTION_VALUE_PERM "perm"
#define ISCSI_TARGET_ALIAS_ATTR_NAME "alias"
#define ISCSI_LINK_LOCAL_ATTR_NAME "link_local"

struct iscsi_key;

Expand Down
6 changes: 6 additions & 0 deletions iscsi-scst/usr/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

struct __qelem targets_list = LIST_HEAD_INIT(targets_list);

int send_targets_link_local = DEFAULT_SEND_TARGETS_LINK_LOCAL;

const char *iscsi_make_full_initiator_name(int per_portal_acl,
const char *initiator_name, const char *target_portal,
char *buf, int size)
Expand Down Expand Up @@ -204,6 +206,10 @@ static void target_print_addr(struct connection *conn, char *addr, int family)
{
char taddr[NI_MAXHOST + NI_MAXSERV + 5];

/* Maybe skip IPv6 link local addresses */
if (family == AF_INET6 && !send_targets_link_local && (strncasecmp(addr, "fe80:", 5) == 0))
return;

snprintf(taddr, sizeof(taddr),
(family == AF_INET) ? "%s:%d,1" : "[%s]:%d,1",
addr, server_port);
Expand Down
23 changes: 6 additions & 17 deletions nightly/bin/nightly
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@

# Returns the revision number of the source files with date $1.
get_revision() {
if svn info . >/dev/null 2>&1; then
svn info -r "{$1}" "${scst_repo}" | sed -n 's/^Revision: //p'
else
git log --before="$1" | head -n 1 | cut -f2 -d ' '
fi
git log --before="$1" | head -n 1 | cut -f2 -d ' '
}

runcmd () {
Expand Down Expand Up @@ -54,11 +50,7 @@ usage () {
#----------------------------------------------------------------------------

scst_rootdir="$(dirname "$(dirname "$(cd "$(dirname "$0")" && echo "$PWD")")")"
if svn info . >/dev/null 2>&1; then
scst_repo="$(svn info "$scst_rootdir" | sed -n -e 's|\+ssh://[^@]*@|://|' -e 's/^URL: //p')"
else
scst_repo="$scst_rootdir"
fi
scst_repo="$scst_rootdir"
sendmail_opts=""
run_if_unchanged="false"

Expand Down Expand Up @@ -151,13 +143,10 @@ for logfile in old new ; do
# Check out and run the tests.
runcmd ${logfile} \
"Checking out SCST source tree" \
"if svn info . >/dev/null 2>&1; then \
svn co -q -r {${date}} ${scst_repo} ${ABT_TMPDIR}/scst; \
else \
( rmdir ${ABT_TMPDIR}/scst && \
git clone -q ${scst_repo} ${ABT_TMPDIR}/scst && \
cd ${ABT_TMPDIR}/scst && git reset --hard ${rev} ); \
fi" &&
"( rmdir ${ABT_TMPDIR}/scst && \
git clone -q ${scst_repo} ${ABT_TMPDIR}/scst && \
cd ${ABT_TMPDIR}/scst && git reset --hard ${rev} ); \
" &&
runcmd ${logfile} \
"Running regression tests" \
"cd ${ABT_TMPDIR}/scst && \
Expand Down
29 changes: 15 additions & 14 deletions nightly/conf/nightly.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@
ABT_DETAILS="x86_64"
ABT_JOBS=5
ABT_KERNELS=" \
6.7 \
6.6.11-nc \
6.8.7 \
6.7.12-nc \
6.6.28-nc \
6.5.13-nc \
6.4.16-nc \
6.3.13-nc \
6.2.16-nc \
6.1.72-nc \
6.1.87-nc \
6.0.19-nc \
5.19.17-nc \
5.18.19-nc \
5.17.15-nc \
5.16.20-nc \
5.15.146-nc \
5.15.156-nc \
5.14.21-nc \
5.13.19-nc \
5.12.19-nc \
5.11.22-nc \
5.10.206-nc \
5.10.215-nc \
5.9.16-nc \
5.8.18-nc \
5.7.19-nc \
5.6.19-nc \
5.5.19-nc \
5.4.266-nc \
5.4.274-nc \
5.3.18-nc \
5.2.21-nc \
5.1.21-nc \
5.0.21-nc \
4.20.17-nc \
4.19.304-nc \
4.19.312-nc \
4.18.20-nc \
4.17.19-nc \
4.16.18-nc \
Expand Down Expand Up @@ -62,11 +63,11 @@ ABT_KERNELS=" \
3.12.74-nc \
3.11.10-nc \
3.10.108-nc \
5.14.0-362.13.1.el9_3^AlmaLinux^9.3-nc \
5.14.0-362.24.1.el9_3^AlmaLinux^9.3-nc \
5.14.0-284.30.1.el9_2^AlmaLinux^9.2-nc \
5.14.0-162.23.1.el9_1^AlmaLinux^9.1-nc \
5.14.0-70.30.1.el9_0^AlmaLinux^9.0-nc \
4.18.0-513.5.1.el8_9^AlmaLinux^8.9-nc \
4.18.0-513.24.1.el8_9^AlmaLinux^8.9-nc \
4.18.0-477.13.1.el8_8^AlmaLinux^8.8-nc \
4.18.0-425.19.2.el8_7^AlmaLinux^8.7-nc \
4.18.0-372.32.1.el8_6^AlmaLinux^8.6-nc \
Expand All @@ -76,18 +77,18 @@ ABT_KERNELS=" \
4.18.0-193.28.1.el8_2^CentOS^8.2.2004-nc \
4.18.0-147.8.1.el8_1^CentOS^8.1.1911-nc \
4.18.0-80.11.2.el8_0^CentOS^8.0.1905-nc \
3.10.0-1160.105.1.el7^CentOS^7.9.2009-nc \
3.10.0-1160.108.1.el7^CentOS^7.9.2009-nc \
3.10.0-1127.19.1.el7^CentOS^7.8.2003-nc \
3.10.0-1062.18.1.el7^CentOS^7.7.1908-nc \
3.10.0-957.27.2.el7^CentOS^7.6.1810-nc \
3.10.0-862.14.4.el7^CentOS^7.5.1804-nc \
5.15.0-201.135.6.el9uek^UEK^9-nc \
5.15.0-201.135.6.el8uek^UEK^8-nc \
5.4.17-2136.326.6.el8uek^UEK^8-nc \
5.15.0-205.149.5.1.el9uek^UEK^9-nc \
5.15.0-205.149.5.1.el8uek^UEK^8-nc \
5.4.17-2136.330.7.1.el8uek^UEK^8-nc \
5.4.17-2102.206.1.el8uek^UEK^8-nc \
5.4.17-2036.104.5.el8uek^UEK^8-nc \
5.4.17-2011.7.4.el8uek^UEK^8-nc \
5.4.17-2136.326.6.el7uek^UEK^7-nc \
5.4.17-2136.330.7.1.el7uek^UEK^7-nc \
5.4.17-2102.206.1.el7uek^UEK^7-nc \
5.4.17-2036.104.5.el7uek^UEK^7-nc \
5.4.17-2011.7.4.el7uek^UEK^7-nc \
Expand Down
Loading
Loading