From 0f40b6fb0f3b400e23a13bd458a4d19fa167c86a Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 20:06:31 +0000 Subject: [PATCH 1/9] nightly build: Update kernel versions git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7874 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- nightly/conf/nightly.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 0dc233f4b..e5ba33bfe 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,29 +3,29 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -4.20 \ -4.19.13-nc \ +4.20.2 \ +4.19.15-nc \ 4.18.18-nc \ 4.17.18-nc \ 4.16.18-nc \ 4.15.18-nc \ -4.14.85-nc \ +4.14.93-nc \ 4.13.16-nc \ 4.12.14-nc \ 4.11.12-nc \ 4.10.17-nc \ -4.9.142-nc \ +4.9.150-nc \ 4.8.17-nc \ 4.7.10-nc \ 4.6.7-nc \ 4.5.7-nc \ -4.4.166-nc \ +4.4.170-nc \ 4.3.6-nc \ 4.2.8-nc \ 4.1.52-nc \ 4.0.9-nc \ 3.19.8-nc \ -3.18.128-nc \ +3.18.132-nc \ 3.17.8-nc \ 3.16.60-nc \ 3.15.10-nc \ From f86eb16a7556161c89323b109bf84499f394ef0d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 20:10:47 +0000 Subject: [PATCH 2/9] nightly build: Update kernel versions git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7875 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- nightly/conf/nightly.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index e5ba33bfe..4f123aa3e 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -56,5 +56,5 @@ ABT_KERNELS=" \ 2.6.31.14-nc \ 2.6.30.10-nc \ 2.6.29.6-nc \ -2.6.27.62-nc \ +2.6.27.52-nc \ " From c3ed16a8ef87ea92a71516dbe1e2f589f7b92939 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 21:09:32 +0000 Subject: [PATCH 3/9] scripts/run-regression-tests: Print an error message if downloading a kernel tar ball failed git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7876 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/run-regression-tests | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index fa37fdc0a..1105bd01d 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -647,7 +647,10 @@ do patchdir="patchdir-${kv}" k="${kv}" - download_kernel "$k" || continue + if ! download_kernel "$k"; then + echo "Downloading kernel version $k failed" + continue + fi generate_kernel_patch "$k" "${generate_kernel_patch_options}" || continue ( cd "${outputdir}" && From 0f0131a73de07ce9ff8fb7179c69257bd1899a33 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 21:10:13 +0000 Subject: [PATCH 4/9] scst: Backport scst_blk_rq_cpu() to kernel versions before v2.6.28 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7877 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index b11525117..4ed3cc485 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -123,7 +123,13 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q) static inline unsigned int scst_blk_rq_cpu(struct request *rq) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) + /* + * See also commit c7c22e4d5c1f ("block: add support for IO CPU + * affinity") # v2.6.28. + */ + return 0; +#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) return rq->cpu; #else return blk_mq_rq_cpu(rq); From 26c47ffc4ecf5610946361376a079d1ad52a0793 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 21:10:46 +0000 Subject: [PATCH 5/9] scst: Provide a definition for bdev_io_opt() for kernel versions < v2.6.32 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7878 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index 4ed3cc485..26604c190 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -119,6 +119,14 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q) } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) +/* See also commit ac481c20ef8f ("block: Topology ioctls") # v2.6.32 */ +static inline int bdev_io_opt(struct block_device *bdev) +{ + return 0; +} +#endif + /* */ static inline unsigned int scst_blk_rq_cpu(struct request *rq) From 1497af694b19f3603fbd3ea0816751991203d532 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 21:11:22 +0000 Subject: [PATCH 6/9] scst_vdisk: Fix the build for old kernel versions (v2.6.x) git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7879 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 3931a87c9..e4647e3c6 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -25,6 +25,7 @@ #ifndef INSIDE_KERNEL_TREE #include #endif +#include #include #include #include From 497fb8b9f2e69d36122a346f00351cf61bd42e44 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 21:11:54 +0000 Subject: [PATCH 7/9] scst: Backport kernel_read() to kernel versions before v4.14 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7880 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index 26604c190..55c3b477f 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -434,6 +434,33 @@ static inline ssize_t call_write_iter(struct file *file, struct kiocb *kio, } #endif +/* See also commit bdd1d2d3d251 ("fs: fix kernel_read prototype") # v4.14 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) +static inline ssize_t +kernel_read_backport(struct file *file, void *buf, size_t count, loff_t *pos) +{ + return kernel_read(file, *pos, buf, count); +} + +#define kernel_read(file, buf, count, pos) \ + kernel_read_backport((file), (buf), (count), (pos)) + +/* + * See also commit 7bb307e894d5 ("export kernel_write(), convert open-coded + * instances") # v3.10. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +static inline ssize_t +kernel_write_backport(struct file *file, void *buf, size_t count, loff_t *pos) +{ + return kernel_write(file, *pos, buf, count); +} + +#define kernel_write(file, buf, count, pos) \ + kernel_write_backport((file), (buf), (count), (pos)) +#endif +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) || \ LINUX_VERSION_CODE >= KERNEL_VERSION(4, 21, 0) From 9a36a84c0ed0710a931ee0d12358049178a9d933 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 21:13:28 +0000 Subject: [PATCH 8/9] scst/include/backport.h: Suppress a compiler warning Avoid that building SCST with gcc version 8 or later againstkernel v4.14 or before triggers a compiler warning about casting a function pointer to an incompatible type. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7881 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 55c3b477f..3348bd080 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1004,7 +1004,7 @@ struct t10_pi_tuple { #undef DEFINE_TIMER #define DEFINE_TIMER(_name, _function) \ struct timer_list _name = TIMER_INITIALIZER( \ - (void (*)(unsigned long))(_function), 0, \ + (void (*)(unsigned long))(unsigned long)(_function), 0, \ (unsigned long)&(_name)) #endif From ae0037f88c069af0ccf23ccb9ee9ee4cd65a2589 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 21:14:12 +0000 Subject: [PATCH 9/9] ib_srpt: Fix the build against kernel version v2.6.30 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7882 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index bfc552285..d4d5f1e53 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -156,7 +156,11 @@ module_param(use_node_guid_in_target_name, bool, 0444); MODULE_PARM_DESC(use_node_guid_in_target_name, "Use HCA node GUID as SCST target name."); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) +static int srpt_get_u64_x(char *buffer, struct kernel_param *kp) +#else static int srpt_get_u64_x(char *buffer, const struct kernel_param *kp) +#endif { return sprintf(buffer, "0x%016llx", *(u64 *)kp->arg); } @@ -1094,6 +1098,7 @@ static int srpt_zerolength_write(struct srpt_rdma_ch *ch) static inline void *srpt_get_desc_buf(struct srp_cmd *srp_cmd) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) /* * The pointer computations below will only be compiled correctly * if srp_cmd::add_data is declared as s8*, u8*, s8[] or u8[], so check @@ -1101,6 +1106,7 @@ static inline void *srpt_get_desc_buf(struct srp_cmd *srp_cmd) */ BUILD_BUG_ON(!__same_type(srp_cmd->add_data[0], (s8)0) && !__same_type(srp_cmd->add_data[0], (u8)0)); +#endif /* * According to the SRP spec, the lower two bits of the 'ADDITIONAL