Skip to content

Commit

Permalink
Merge pull request #36 from truenas/rebase_on_master
Browse files Browse the repository at this point in the history
Rebase truenas-3.9.0-pre on master
  • Loading branch information
bmeagherix authored Nov 13, 2024
2 parents cca19a4 + 27618ab commit 3b30818
Show file tree
Hide file tree
Showing 34 changed files with 138 additions and 94 deletions.
31 changes: 2 additions & 29 deletions .github/workflows/checkpatch_pull.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Checkpatch upon pull
name: Checkpatch upon pull request

on:
pull_request:
Expand All @@ -24,31 +24,4 @@ jobs:
- name: Run checkpatch.pl
run: |
ignore=(
MISSING_SIGN_OFF
EMAIL_SUBJECT
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[*]}
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"
echo "========================================"
git format-patch -1 --stdout $commit | ./checkpatch.pl --no-tree --show-types --ignore="${ignore_str// /,}" - || err=1
echo
done
exit $err
CHECKPATCH_PATH=. ./scripts/checkpatch_commits ${{github.event.pull_request.base.sha}}
18 changes: 1 addition & 17 deletions .github/workflows/checkpatch_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,4 @@ jobs:
- name: Run checkpatch.pl
run: |
ignore=(
MISSING_SIGN_OFF
EMAIL_SUBJECT
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[*]}
git format-patch -1 --stdout | ./checkpatch.pl --no-tree --show-types --ignore="${ignore_str// /,}" -
git format-patch -1 --stdout | CHECKPATCH_PATH=. ./scripts/checkpatch
5 changes: 4 additions & 1 deletion .github/workflows/run_regression_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Regression tests upon push
name: Run regression tests

on:
push:
branches:
- master
- nightly/update
pull_request:
branches:
- master

jobs:
regression_tests:
Expand Down
1 change: 0 additions & 1 deletion fcst/ft_sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/hash.h>
#include <asm/unaligned.h>
#include <scsi/libfc.h>
#include <scsi/fc/fc_els.h>
#include "fcst.h"
Expand Down
1 change: 0 additions & 1 deletion iscsi-scst/include/iscsit_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ extern void iscsit_unreg_transport(struct iscsit_transport *t);
extern struct iscsit_transport *iscsit_get_transport(enum iscsit_transport_type type);

#endif /* __ISCSI_TRANSPORT_H__ */

1 change: 0 additions & 1 deletion iscsi-scst/kernel/iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <net/tcp.h>
#include <scsi/scsi.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#ifdef INSIDE_KERNEL_TREE
#include <scst/iscsit_transport.h>
#else
Expand Down
3 changes: 1 addition & 2 deletions iscsi-scst/kernel/isert-scst/iser_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)

snprintf(wq_name, sizeof(wq_name), "isert_cq_%p", cq_desc);
cq_desc->cq_workqueue = alloc_workqueue(wq_name,
WQ_CPU_INTENSIVE|
WQ_MEM_RECLAIM, 1);
WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1);
if (unlikely(!cq_desc->cq_workqueue)) {
PRINT_ERROR("Failed to alloc iser cq work queue for dev:%s",
ib_dev->name);
Expand Down
4 changes: 4 additions & 0 deletions iscsi-scst/kernel/isert-scst/isert_login.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,9 @@ static dev_t devno;

static const struct file_operations listener_fops = {
.owner = THIS_MODULE,
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
.llseek = no_llseek,
#endif
.read = isert_listen_read,
.unlocked_ioctl = isert_listen_ioctl,
.compat_ioctl = isert_listen_ioctl,
Expand All @@ -900,7 +902,9 @@ static const struct file_operations listener_fops = {

static const struct file_operations conn_fops = {
.owner = THIS_MODULE,
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
.llseek = no_llseek,
#endif
.read = isert_read,
.write = isert_write,
.unlocked_ioctl = isert_ioctl,
Expand Down
1 change: 0 additions & 1 deletion qla2x00t-32gbit/qla2x00-target/qla_tgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <linux/delay.h>
#include <linux/list.h>
#include <linux/workqueue.h>
#include <asm/unaligned.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
Expand Down
1 change: 0 additions & 1 deletion qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/list.h>
#include <asm/unaligned.h>
#include <linux/vmalloc.h>
#ifdef INSIDE_KERNEL_TREE
#include <scst/scst.h>
Expand Down
6 changes: 5 additions & 1 deletion qla2x00t-32gbit/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
#include <linux/aer.h>
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
#include <asm/unaligned.h>
#else
#include <linux/unaligned.h>
#endif
#include <linux/mutex.h>
#include <linux/btree.h>
#include <linux/version.h>
Expand Down Expand Up @@ -2676,7 +2681,6 @@ typedef struct fc_port {
struct kref sess_kref;
struct qla_tgt *tgt;
unsigned long expires;
struct list_head del_list_entry;
struct work_struct free_work;
struct work_struct reg_work;
uint64_t jiffies_at_registration;
Expand Down
7 changes: 7 additions & 0 deletions qla2x00t-32gbit/qla_dsd.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#ifndef _QLA_DSD_H_
#define _QLA_DSD_H_

#ifndef INSIDE_KERNEL_TREE
#include <linux/version.h>
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
#include <asm/unaligned.h>
#else
#include <linux/unaligned.h>
#endif

/* 32-bit data segment descriptor (8 bytes) */
struct dsd32 {
Expand Down
6 changes: 4 additions & 2 deletions qla2x00t-32gbit/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -3568,11 +3568,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)

if (IS_QLA8031(ha) || IS_MCTP_CAPABLE(ha)) {
sprintf(wq_name, "qla2xxx_%lu_dpc_lp_wq", base_vha->host_no);
ha->dpc_lp_wq = create_singlethread_workqueue(wq_name);
ha->dpc_lp_wq =
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name);
INIT_WORK(&ha->idc_aen, qla83xx_service_idc_aen);

sprintf(wq_name, "qla2xxx_%lu_dpc_hp_wq", base_vha->host_no);
ha->dpc_hp_wq = create_singlethread_workqueue(wq_name);
ha->dpc_hp_wq =
alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name);
INIT_WORK(&ha->nic_core_reset, qla83xx_nic_core_reset_work);
INIT_WORK(&ha->idc_state_handler,
qla83xx_idc_state_handler_work);
Expand Down
1 change: 0 additions & 1 deletion qla2x00t-32gbit/qla_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <linux/delay.h>
#include <linux/list.h>
#include <linux/workqueue.h>
#include <asm/unaligned.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
Expand Down
2 changes: 0 additions & 2 deletions qla2x00t-32gbit/qla_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#ifndef __QLA_TARGET_H
#define __QLA_TARGET_H

#include <linux/version.h>
#include <asm/unaligned.h>
#include "qla_def.h"
#include "qla_dsd.h"

Expand Down
1 change: 0 additions & 1 deletion qla2x00t/qla2x00-target/qla2x00t.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <linux/delay.h>
#include <linux/list.h>
#include <linux/workqueue.h>
#include <asm/unaligned.h>

#ifdef INSIDE_KERNEL_TREE
#include <scst/scst.h>
Expand Down
29 changes: 19 additions & 10 deletions scripts/checkpatch
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

scriptpath=${CHECKPATCH_PATH:-/lib/modules/$(uname -r)/build/scripts}

ignore=(
CONSTANT_COMPARISON
LINUX_VERSION_CODE
LONG_LINE
LONG_LINE_COMMENT
LONG_LINE_STRING
RETURN_VOID
SPDX_LICENSE_TAG
SYMBOLIC_PERMS
MISSING_SIGN_OFF
EMAIL_SUBJECT
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
)
../linux-kernel/scripts/checkpatch.pl -f --show-types --ignore="$(echo "${ignore[@]}" | sed 's/ /,/g')" $(list-source-files | grep -vE '^debian/|^fcst/linux-patches|patch$|pdf$|png$|^iscsi-scst/usr|^qla|^scripts/|^scstadmin/|^usr/|^www/') | sed 's/^#[0-9]*: FILE: \(.*\):/\1:1:/'
ignore_str=${ignore[*]}

${scriptpath}/checkpatch.pl --no-tree --show-types --strict --ignore="${ignore_str// /,}" $@
21 changes: 21 additions & 0 deletions scripts/checkpatch_commits
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -e

rootdir=$(readlink -f $(dirname $0)/..)
scriptsdir=${rootdir}/scripts
base_commit=${1:-master}

commits=$(cd ${rootdir} && git log --pretty=format:"%h" ${base_commit}..HEAD)
err=0

for commit in $commits; do
echo "Running checkpatch for commit $commit"
echo -e "========================================\n"

(cd ${rootdir} &&
git format-patch -1 --stdout $commit | ${scriptsdir}/checkpatch -) || err=1
echo -e "\n"
done

exit $err
13 changes: 13 additions & 0 deletions scripts/checkpatch_diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e

rootdir=$(readlink -f $(dirname $0)/..)
scriptsdir=${rootdir}/scripts
base_commit=${1:-master}

err=0

(cd ${rootdir} && git diff ${base_commit} | ${scriptsdir}/checkpatch -) || err=1

exit $err
24 changes: 24 additions & 0 deletions scripts/checkpatch_scan
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

set -e

rootdir=$(readlink -f $(dirname $0)/..)
scriptsdir=${rootdir}/scripts
outputfile=checkpatch.out

src_files=$(${scriptsdir}/list-source-files ${rootdir} | \
grep -vE '^debian/|^fcst/linux-patches|patch$|pdf$|png$|^iscsi-scst/usr|^qla|^scripts/|^scstadmin/|^usr/|^www/' | \
while read -r filename; do echo "${rootdir}/$filename"; done)
${scriptsdir}/checkpatch -f $src_files 1> ${outputfile} || true
errors=$(grep -c '^ERROR' "${outputfile}")
warnings=$(grep -c '^WARNING' "${outputfile}")
checks=$(grep -c '^CHECK' "${outputfile}")
echo "${errors} errors / ${warnings} warnings / ${checks} checks."
grep -E '^WARNING|^ERROR|^CHECK' "${outputfile}" |
sort |
sed 's/^CHECK:CAMELCASE: Avoid CamelCase:.*/CHECK:CAMELCASE Avoid CamelCase/' |
uniq -c
14 changes: 9 additions & 5 deletions scripts/run-regression-tests
Original file line number Diff line number Diff line change
Expand Up @@ -231,25 +231,29 @@ function run_checkpatch {
if [ "${multiple_patches}" = "false" ]; then
echo "Running checkpatch on the SCST kernel patch ..."
( cd "${outputdir}/linux-$1" \
&& scripts/checkpatch.pl --no-tree --no-signoff - < "${patchfile}" &> "${outputfile}")
&& scripts/checkpatch.pl --no-tree --no-signoff --strict - < "${patchfile}" &> "${outputfile}")
else
echo "Running checkpatch on the SCST kernel patches ..."
rm -f "${outputfile}"
( cd "${outputdir}/linux-$1" \
&& for p in "${outputdir}/${patchdir}"/*
do
echo "==== $p" >>"${outputfile}"
scripts/checkpatch.pl --no-tree --no-signoff - < "$p" >> "${outputfile}" 2>&1
scripts/checkpatch.pl --no-tree --no-signoff --strict - < "$p" >> "${outputfile}" 2>&1
done
)
fi

errors=$(grep -c '^ERROR' "${outputfile}")
warnings=$(grep -c '^WARNING' "${outputfile}")
echo "${errors} errors / ${warnings} warnings."
grep -E '^WARNING|^ERROR' "${outputfile}" |
checks=$(grep -c '^CHECK' "${outputfile}")

echo "${errors} errors / ${warnings} warnings / ${checks} checks."

grep -E '^WARNING|^ERROR|^CHECK' "${outputfile}" |
sort |
grep -v 'WARNING: missing space after return type' |
sed 's/^WARNING: Avoid CamelCase:.*/WARNING: Avoid CamelCase/' |
sed 's/^CHECK: Avoid CamelCase:.*/CHECK: Avoid CamelCase/' |
uniq -c
else
echo "Skipping checkpatch step for kernel $1."
Expand Down
10 changes: 8 additions & 2 deletions scst/include/backport.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
#include <scsi/scsi_eh.h> /* scsi_build_sense_buffer() */
struct scsi_target;
#include <scsi/scsi_transport_fc.h> /* struct bsg_job */
#include <asm/unaligned.h> /* get_unaligned_be64() */
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
#include <asm/unaligned.h>
#else
#include <linux/unaligned.h>
#endif

/* <asm-generic/barrier.h> */

Expand Down Expand Up @@ -284,7 +288,9 @@ static inline void blkdev_put_backport(struct block_device *bdev, void *holder)

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0) && \
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(6, 6, 0) >> 8 || \
LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 23))
LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 23)) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 5))
/*
* See also commit e719b4d15674 ("block: Provide bdev_open_* functions") # v6.7, v6.6.23.
*/
Expand Down
6 changes: 5 additions & 1 deletion scst/include/scst.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/sched/signal.h>
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
#include <asm/unaligned.h>
#else
#include <linux/unaligned.h>
#endif
#include <linux/wait.h>
#include <linux/cpumask.h>
#include <linux/dlm.h>
#include <asm/unaligned.h>

#if 0 /* Let's disable it for now to see if users will complain about it */
#define CONFIG_SCST_PER_DEVICE_CMD_COUNT_LIMIT
Expand Down
1 change: 0 additions & 1 deletion scst/src/dev_handlers/scst_cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/cdrom.h>
#include <scsi/scsi_host.h>
#include <linux/slab.h>
#include <asm/unaligned.h>

#define LOG_PREFIX "dev_cdrom"

Expand Down
Loading

0 comments on commit 3b30818

Please sign in to comment.