From 64737849f815bae8c07914e1b7c4e0f12dc06411 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 23 Oct 2015 05:47:49 +0000 Subject: [PATCH 01/13] nightly build: Update kernel versions git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6551 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- nightly/conf/nightly.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 8ccddc98d..184d9bb95 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,19 +3,19 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -4.2.3 \ -4.1.10-nc \ +4.2.4 \ +4.1.11-nc \ 4.0.9-nc \ 3.19.7-nc \ 3.18.19-nc \ 3.17.8-nc \ 3.16.7-nc \ 3.15.10-nc \ -3.14.54-nc \ +3.14.55-nc \ 3.13.11-nc \ 3.12.44-nc \ 3.11.10-nc \ -3.10.90-nc \ +3.10.91-nc \ 3.9.11-nc \ 3.8.13-nc \ 3.7.10-nc \ From 46202aa8239d225f82d3675f14b23939ffe4f8a0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 16:55:48 +0000 Subject: [PATCH 02/13] isert: Fix null dereference in isert_cmnd allocation code In a state where the list isert_conn->tx_free_list is empty (mostly under traffic), we might fail to receive a command from the isert command pool. This will result in later null deref. In this case, busy-wait until a command will be available (will be freed by the receive context). [2158233.952087] BUG: unable to handle kernel NULL pointer dereference at (null) [2158233.956023] IP: [] isert_pdu_send+0xc0/0x1f0 [isert_scst] .... [2158233.956023] [] ? isert_cmnd_alloc+0x78/0x110 [isert_scst] [2158233.956023] [] req_cmnd_release+0x50/0x130 [iscsi_scst] [2158233.956023] [] iscsi_send_nop_in+0x19b/0x370 [iscsi_scst] Signed-off-by: Ariel Nahum git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6554 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_datamover.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iscsi-scst/kernel/isert-scst/iser_datamover.c b/iscsi-scst/kernel/isert-scst/iser_datamover.c index 15c40713a..19fc58640 100644 --- a/iscsi-scst/kernel/isert-scst/iser_datamover.c +++ b/iscsi-scst/kernel/isert-scst/iser_datamover.c @@ -126,7 +126,12 @@ static struct iscsi_cmnd *isert_alloc_scsi_pdu(struct iscsi_conn *iscsi_conn, struct isert_connection *isert_conn = (struct isert_connection *)iscsi_conn; struct isert_cmnd *isert_pdu; +again: spin_lock(&isert_conn->tx_lock); + if (list_empty(&isert_conn->tx_free_list)) { + spin_unlock(&isert_conn->tx_lock); + goto again; + } isert_pdu = list_first_entry(&isert_conn->tx_free_list, struct isert_cmnd, pool_node); list_move(&isert_pdu->pool_node, &isert_conn->tx_busy_list); From 1e9ec5d21a1581869658a5782784b01a7416e365 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 17:24:23 +0000 Subject: [PATCH 03/13] scst/include/backport.h: Install this header and include it in the RPM git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6555 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst.spec.in | 1 + scst/src/Makefile | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scst.spec.in b/scst.spec.in index f2ae36fe7..c1c067c79 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -179,6 +179,7 @@ rm -rf /usr/local/include/scst %defattr(-,root,root) %dir /usr/include/scst /usr/include/scst/Module.symvers +/usr/include/scst/backport.h /usr/include/scst/scst.h /usr/include/scst/scst_const.h /usr/include/scst/scst_debug.h diff --git a/scst/src/Makefile b/scst/src/Makefile index 28107ff99..1110bbf93 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -111,12 +111,11 @@ install: all install -m 644 dev_handlers/*.ko $(INSTALL_DIR)/dev_handlers install -m 644 scst.ko $(INSTALL_DIR) install -d $(INSTALL_DIR_H) - install -m 644 ../include/scst.h $(INSTALL_DIR_H) - install -m 644 ../include/scst_sgv.h $(INSTALL_DIR_H) - install -m 644 ../include/scst_debug.h $(INSTALL_DIR_H) - install -m 644 ../include/scst_user.h $(INSTALL_DIR_H) - install -m 644 ../include/scst_const.h $(INSTALL_DIR_H) - install -m 644 ../include/scst_itf_ver.h $(INSTALL_DIR_H) + header_files="backport.h scst.h scst_const.h scst_debug.h \ + scst_itf_ver.h scst_sgv.h scst_user.h"; \ + for h in $${header_files}; do \ + install -m 644 ../include/$$h $(INSTALL_DIR_H); \ + done rm -f $(INSTALL_DIR_H)/$(MODULE_SYMVERS) install -m 644 $(MODULE_SYMVERS) $(INSTALL_DIR_H) -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) From dad9e0317cf49a24ab7c88bcbfee9b1614a6b2bb Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 18:09:04 +0000 Subject: [PATCH 04/13] list-source-files: Fix the behavior for processing soft links git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6556 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/list-source-files | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/list-source-files b/scripts/list-source-files index 4a2eed863..21320d197 100755 --- a/scripts/list-source-files +++ b/scripts/list-source-files @@ -1,12 +1,18 @@ #!/bin/bash +inode() { + ls -id "$1" | { read a b; echo "$a"; } +} + list_source_files() { local d r d="$(cd "$1" && echo "$PWD")" r="$d" - while [ "$r" != "/" -a ! -e "$r/.svn" -a ! -e "$r/.git" -a ! -e "$r/.hg" ]; do - r="$(dirname "$r")" + inode_root="$(inode /)" + while [ $(inode "$r") != "${inode_root}" -a \ + ! -e "$r/.svn" -a ! -e "$r/.git" -a ! -e "$r/.hg" ]; do + r="$r/.." done if [ -e "$r/.svn" ]; then From c8b2fd0808087e05a62a62cbb616ed46dffd3dc7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 18:10:19 +0000 Subject: [PATCH 05/13] scst.spec: Use QLogic target driver source code from the QLogic git tree if available git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6557 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- Makefile | 13 ++++++++----- scst.spec.in | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e17b06726..c984d1a62 100644 --- a/Makefile +++ b/Makefile @@ -410,16 +410,19 @@ fcst_extraclean: scst-dist-gzip: name=scst && \ mkdir $${name}-$(VERSION) && \ - { if [ -h qla2x00t ] || { mount | grep "on $$PWD/qla2x00t type"; }; \ - then \ + { \ + if [ -e qla2x00t_git ]; then \ scripts/list-source-files | grep -v ^qla2x00t/; \ - find qla2x00t/ -type f; \ + ( dir="$$PWD" && cd qla2x00t_git && \ + "$$dir/scripts/list-source-files" ) | \ + sed 's,^,qla2x00t_git/,'; \ else \ scripts/list-source-files; \ fi | \ - grep -E '^doc/|^fcst/|^iscsi-scst/|^Makefile|^qla2x00t/|^scst.spec|^scst/|^scst_local/|^srpt/'|\ + grep -E '^doc/|^fcst/|^iscsi-scst/|^Makefile|^qla2x00t(|_git)/|^scst.spec|^scst/|^scst_local/|^srpt/'|\ tar -T- -cf- | \ - tar -C $${name}-$(VERSION) -xf-; } && \ + tar -C $${name}-$(VERSION) -xf-; \ + } && \ rm -f $${name}-$(VERSION).tar.bz2 && \ tar -cjf $${name}-$(VERSION).tar.bz2 $${name}-$(VERSION) && \ rm -rf $${name}-$(VERSION) diff --git a/scst.spec.in b/scst.spec.in index c1c067c79..b6b528f7b 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -113,9 +113,15 @@ export KVER=%{kversion} PREFIX=%{_prefix} %{?kdir:%{expand:%%(export KDIR=%{kdir})}} export BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y make 2release -for d in scst fcst iscsi-scst qla2x00t/qla2x00-target scst_local srpt; do +for d in scst fcst iscsi-scst scst_local srpt; do %{make} -C $d done +for d in qla2x00t_git/qla2x00-target qla2x00t/qla2x00-target; do + if [ -e $d ]; then + %{make} -C $d + break + fi +done %install export KVER=%{kversion} PREFIX=%{_prefix} MANDIR=%{_mandir} @@ -124,9 +130,15 @@ export BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y for d in scst; do DESTDIR=%{buildroot} %{make} -C $d install done -for d in fcst iscsi-scst qla2x00t/qla2x00-target scst_local srpt; do +for d in fcst iscsi-scst scst_local srpt; do DESTDIR=%{buildroot} INSTALL_MOD_PATH=%{buildroot} %{make} -C $d install done +for d in qla2x00t_git/qla2x00-target qla2x00t/qla2x00-target; do + if [ -e $d ]; then + DESTDIR=%{buildroot} INSTALL_MOD_PATH=%{buildroot} %{make} -C $d install + break + fi +done rm -f %{buildroot}/lib/modules/%{kversion}/[Mm]odule* %clean From 4f4edc3f6f4e505080bc000de324fa572fde9410 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 19:00:05 +0000 Subject: [PATCH 06/13] scst: Move backports from scst.h to backport.h - step 1 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6558 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 199 ++++++++++++++++++++++++++++++++++++++++ scst/include/scst.h | 183 ------------------------------------ 2 files changed, 199 insertions(+), 183 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index d4c870cc5..517cc27e3 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -22,6 +22,162 @@ #include /* sync_page_range() */ +/* */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) +#define smp_mb__after_atomic_inc smp_mb__after_atomic +#define smp_mb__after_clear_bit smp_mb__after_atomic +#define smp_mb__before_atomic_dec smp_mb__before_atomic +#define smp_mb__after_atomic_dec smp_mb__after_atomic +#endif + +/* */ + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 32) +#ifndef O_DSYNC +#define O_DSYNC O_SYNC +#endif +#endif + +/* */ + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) +#ifndef __printf +#define __printf(a, b) __attribute__((format(printf,a,b))) +#endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) +#ifndef __aligned +#define __aligned(x) __attribute__((aligned(x))) +#endif +#ifndef __packed +#define __packed __attribute__((packed)) +#endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +/* + * See also patch "Move ACCESS_ONCE() to " (commit ID + * 9c3cdc1f83a6e07092392ff4aba6466517dbd1d0). + */ +#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) +#endif + +/* */ + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) && !defined(BACKPORT_LINUX_CPUMASK_H) +#define nr_cpu_ids NR_CPUS +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) && defined(__LINUX_CPUMASK_H) +/* + * See also patch "cpumask: introduce new API, without changing anything" + * (commit ID 2d3854a37e8b). + */ +typedef cpumask_t cpumask_var_t[1]; +#define cpumask_bits(maskp) ((maskp)->bits) +#ifdef CONFIG_CPUMASK_OFFSTACK +/* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, + * not all bits may be allocated. */ +#define nr_cpumask_bits nr_cpu_ids +#else +#define nr_cpumask_bits NR_CPUS +#endif + +#ifdef CONFIG_CPUMASK_OFFSTACK +bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); +void free_cpumask_var(cpumask_var_t mask); +#else +static inline void free_cpumask_var(cpumask_var_t mask) +{ +} + +static inline bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags) +{ + return true; +} +#endif + +/* verify cpu argument to cpumask_* operators */ +static inline unsigned int cpumask_check(unsigned int cpu) +{ +#ifdef CONFIG_DEBUG_PER_CPU_MAPS + WARN_ON_ONCE(cpu >= nr_cpumask_bits); +#endif /* CONFIG_DEBUG_PER_CPU_MAPS */ + return cpu; +} + +/** + * cpumask_next - get the next cpu in a cpumask + * @n: the cpu prior to the place to search (ie. return will be > @n) + * @srcp: the cpumask pointer + * + * Returns >= nr_cpu_ids if no further cpus set. + */ +static inline unsigned int cpumask_next(int n, const cpumask_t *srcp) +{ + /* -1 is a legal arg here. */ + if (n != -1) + cpumask_check(n); + return find_next_bit(cpumask_bits(srcp), nr_cpumask_bits, n+1); +} + +/** + * for_each_cpu - iterate over every cpu in a mask + * @cpu: the (optionally unsigned) integer iterator + * @mask: the cpumask pointer + * + * After the loop, cpu is >= nr_cpu_ids. + */ +#define for_each_cpu(cpu, mask) \ + for ((cpu) = -1; \ + (cpu) = cpumask_next((cpu), (mask)), \ + (cpu) < nr_cpu_ids;) + +/** + * cpumask_set_cpu - set a cpu in a cpumask + * @cpu: cpu number (< nr_cpu_ids) + * @dstp: the cpumask pointer + */ +static inline void cpumask_set_cpu(unsigned int cpu, cpumask_t *dstp) +{ + set_bit(cpu, cpumask_bits(dstp)); +} + +/** + * cpumask_copy - *dstp = *srcp + * @dstp: the result + * @srcp: the input cpumask + */ +static inline void cpumask_copy(cpumask_t *dstp, + const cpumask_t *srcp) +{ + bitmap_copy(cpumask_bits(dstp), cpumask_bits(srcp), nr_cpumask_bits); +} + +/** + * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask + * @dstp: the cpumask pointer + */ +static inline void cpumask_setall(cpumask_t *dstp) +{ + bitmap_fill(cpumask_bits(dstp), nr_cpumask_bits); +} + +/** + * cpumask_equal - *src1p == *src2p + * @src1p: the first input + * @src2p: the second input + */ +static inline bool cpumask_equal(const cpumask_t *src1p, + const cpumask_t *src2p) +{ + return bitmap_equal(cpumask_bits(src1p), cpumask_bits(src2p), + nr_cpumask_bits); +} +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) && \ @@ -52,4 +208,47 @@ static inline int vfs_fsync_backport(struct file *file, int datasync) #define vfs_fsync vfs_fsync_backport #endif +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) +#ifndef RHEL_RELEASE_CODE +typedef _Bool bool; +#endif +#define true 1 +#define false 0 +#endif + +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) +#define lockdep_assert_held(l) do { (void)(l); } while (0) +#endif + +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +/* + * See also patch "fix abuses of ptrdiff_t" (commit ID + * 142956af525002c5378e7d91d81a01189841a785). + */ +typedef unsigned long uintptr_t; +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap); +#endif + +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +/* + * See also patch "[SCSI] bidirectional command support" + * (commit ID 6f9a35e2dafa). + */ +static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) +{ + return false; +} +#endif + #endif /* _SCST_BACKPORT_H_ */ diff --git a/scst/include/scst.h b/scst/include/scst.h index 8c00799fe..916625725 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -71,195 +71,12 @@ #include #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) -#define smp_mb__after_atomic_inc smp_mb__after_atomic -#define smp_mb__after_clear_bit smp_mb__after_atomic -#define smp_mb__before_atomic_dec smp_mb__before_atomic -#define smp_mb__after_atomic_dec smp_mb__after_atomic -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) -#ifndef RHEL_RELEASE_CODE -typedef _Bool bool; -#endif -#define true 1 -#define false 0 -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) -#ifndef __packed -#define __packed __attribute__((packed)) -#endif -#ifndef __aligned -#define __aligned(x) __attribute__((aligned(x))) -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) -char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap); -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) -#define lockdep_assert_held(l) do { (void)(l); } while (0) -#endif - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 32) -#ifndef O_DSYNC -#define O_DSYNC O_SYNC -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) -/* - * See also patch "Move ACCESS_ONCE() to " (commit ID - * 9c3cdc1f83a6e07092392ff4aba6466517dbd1d0). - */ -#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) -#endif - #ifdef INSIDE_KERNEL_TREE #include #else #include "scst_sgv.h" #endif -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) -#ifndef __printf -#define __printf(a, b) __attribute__((format(printf,a,b))) -#endif -#endif - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) && !defined(BACKPORT_LINUX_CPUMASK_H) -#define nr_cpu_ids NR_CPUS -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) -/* - * See also patch "fix abuses of ptrdiff_t" (commit ID - * 142956af525002c5378e7d91d81a01189841a785). - */ -typedef unsigned long uintptr_t; -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) -/* - * See also patch "[SCSI] bidirectional command support" - * (commit ID 6f9a35e2dafa). - */ -static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) -{ - return false; -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) && defined(__LINUX_CPUMASK_H) -/* - * See also patch "cpumask: introduce new API, without changing anything" - * (commit ID 2d3854a37e8b). - */ -typedef cpumask_t cpumask_var_t[1]; -#define cpumask_bits(maskp) ((maskp)->bits) -#ifdef CONFIG_CPUMASK_OFFSTACK -/* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, - * not all bits may be allocated. */ -#define nr_cpumask_bits nr_cpu_ids -#else -#define nr_cpumask_bits NR_CPUS -#endif - -#ifdef CONFIG_CPUMASK_OFFSTACK -bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); -void free_cpumask_var(cpumask_var_t mask); -#else -static inline void free_cpumask_var(cpumask_var_t mask) -{ -} - -static inline bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags) -{ - return true; -} -#endif - -/* verify cpu argument to cpumask_* operators */ -static inline unsigned int cpumask_check(unsigned int cpu) -{ -#ifdef CONFIG_DEBUG_PER_CPU_MAPS - WARN_ON_ONCE(cpu >= nr_cpumask_bits); -#endif /* CONFIG_DEBUG_PER_CPU_MAPS */ - return cpu; -} - -/** - * cpumask_next - get the next cpu in a cpumask - * @n: the cpu prior to the place to search (ie. return will be > @n) - * @srcp: the cpumask pointer - * - * Returns >= nr_cpu_ids if no further cpus set. - */ -static inline unsigned int cpumask_next(int n, const cpumask_t *srcp) -{ - /* -1 is a legal arg here. */ - if (n != -1) - cpumask_check(n); - return find_next_bit(cpumask_bits(srcp), nr_cpumask_bits, n+1); -} - -/** - * for_each_cpu - iterate over every cpu in a mask - * @cpu: the (optionally unsigned) integer iterator - * @mask: the cpumask pointer - * - * After the loop, cpu is >= nr_cpu_ids. - */ -#define for_each_cpu(cpu, mask) \ - for ((cpu) = -1; \ - (cpu) = cpumask_next((cpu), (mask)), \ - (cpu) < nr_cpu_ids;) - -/** - * cpumask_set_cpu - set a cpu in a cpumask - * @cpu: cpu number (< nr_cpu_ids) - * @dstp: the cpumask pointer - */ -static inline void cpumask_set_cpu(unsigned int cpu, cpumask_t *dstp) -{ - set_bit(cpu, cpumask_bits(dstp)); -} - -/** - * cpumask_copy - *dstp = *srcp - * @dstp: the result - * @srcp: the input cpumask - */ -static inline void cpumask_copy(cpumask_t *dstp, - const cpumask_t *srcp) -{ - bitmap_copy(cpumask_bits(dstp), cpumask_bits(srcp), nr_cpumask_bits); -} - -/** - * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask - * @dstp: the cpumask pointer - */ -static inline void cpumask_setall(cpumask_t *dstp) -{ - bitmap_fill(cpumask_bits(dstp), nr_cpumask_bits); -} - -/** - * cpumask_equal - *src1p == *src2p - * @src1p: the first input - * @src2p: the second input - */ -static inline bool cpumask_equal(const cpumask_t *src1p, - const cpumask_t *src2p) -{ - return bitmap_equal(cpumask_bits(src1p), cpumask_bits(src2p), - nr_cpumask_bits); -} -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && \ (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6) #define set_cpus_allowed_ptr(p, new_mask) set_cpus_allowed((p), *(new_mask)) From 4938861aa282aa1294bb08bed5c33b96fd9cfaf4 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 20:22:57 +0000 Subject: [PATCH 07/13] scst: Move backports from scst.h to backport.h - step 2 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6559 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 235 ++++++++++++++++++++++++++++++++++++++++ scst/include/scst.h | 223 -------------------------------------- 2 files changed, 235 insertions(+), 223 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 517cc27e3..d8ce44ef3 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -39,6 +39,15 @@ #endif #endif +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) +static inline unsigned int queue_max_hw_sectors(struct request_queue *q) +{ + return q->max_hw_sectors; +} +#endif + /* */ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) @@ -218,12 +227,190 @@ typedef _Bool bool; #define false 0 #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) +#ifndef swap +#define swap(a, b) \ + do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) +#endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6 || \ + RHEL_MAJOR -0 == 6 && RHEL_MINOR -0 < 1) +extern int hex_to_bin(char ch); +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) +/* + * See also "lib: hex2bin converts ascii hexadecimal string to binary" (commit + * dc88e46029486ed475c71fe1bb696d39511ac8fe). + */ +static inline void hex2bin(u8 *dst, const char *src, size_t count) +{ + while (count--) { + *dst = hex_to_bin(*src++) << 4; + *dst += hex_to_bin(*src++); + dst++; + } +} +#endif + +/* */ + +#ifndef __list_for_each +/* ToDo: cleanup when both are the same for all relevant kernels */ +#define __list_for_each list_for_each +#endif + +/* + * Returns true if entry is in its list. Entry must be deleted from the + * list by using list_del_init()! + */ +static inline bool list_entry_in_list(const struct list_head *entry) +{ + return !list_empty(entry); +} + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) #define lockdep_assert_held(l) do { (void)(l); } while (0) #endif +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) +/* + * See also patch "sched: Fix softirq time accounting" (commit ID + * 75e1056f5c57050415b64cb761a3acc35d91f013). + */ +#ifndef in_serving_softirq +#define in_serving_softirq() in_softirq() +#endif +#endif + +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) +#ifndef pr_err +#define pr_err(fmt, ...) printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) +#endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) +/* + * See also patch "kernel.h: add pr_warn for symmetry to dev_warn, + * netdev_warn" (commit fc62f2f19edf46c9bdbd1a54725b56b18c43e94f). + */ +#ifndef pr_warn +#define pr_warn pr_warning +#endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6) +/* + * See also patch "Add a dummy printk function for the maintenance of unused + * printks" (commit 12fdff3fc2483f906ae6404a6e8dcf2550310b6f). + */ +static inline __attribute__ ((format (printf, 1, 2))) +int no_printk(const char *s, ...) { return 0; } +#endif + +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6) +#define set_cpus_allowed_ptr(p, new_mask) set_cpus_allowed((p), *(new_mask)) +#endif + +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +/* + * The macro's sg_page(), sg_virt(), sg_init_table(), sg_assign_page() and + * sg_set_page() have been introduced in the 2.6.24 kernel. The definitions + * below are backports of the 2.6.24 macro's for older kernels. There is one + * exception however: when compiling SCST on a system with a pre-2.6.24 kernel + * (e.g. RHEL 5.x) where the OFED kernel headers have been installed, do not + * define the backported macro's because OFED has already defined these. + */ + +static inline bool sg_is_chain(struct scatterlist *sg) +{ + return false; +} + +static inline struct scatterlist *sg_chain_ptr(struct scatterlist *sg) +{ + return NULL; +} + +#define sg_is_last(sg) false + +#ifndef sg_page +static inline struct page *sg_page(struct scatterlist *sg) +{ + return sg->page; +} +#endif + +static inline void *sg_virt(struct scatterlist *sg) +{ + return page_address(sg_page(sg)) + sg->offset; +} + +static inline void sg_mark_end(struct scatterlist *sg) +{ +} + +#ifndef __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ + +static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) +{ + memset(sgl, 0, sizeof(*sgl) * nents); +} + +static inline void sg_assign_page(struct scatterlist *sg, struct page *page) +{ + sg->page = page; +} + +static inline void sg_set_page(struct scatterlist *sg, struct page *page, + unsigned int len, unsigned int offset) +{ + sg_assign_page(sg, page); + sg->offset = offset; + sg->length = len; +} + +#ifndef for_each_sg +/* See also commit 96b418c960af0d5c7185ff5c4af9376eb37ac9d3 */ +#define for_each_sg(sglist, sg, nr, __i) \ + for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next_inline(sg)) +#endif /* for_each_sg */ + +#endif /* __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ */ +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) */ + +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\ + sizeof(struct __struct), __alignof__(struct __struct),\ + (__flags), NULL, NULL) +#endif + +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) +struct t10_pi_tuple { + __be16 guard_tag; + __be16 app_tag; + __be32 ref_tag; +}; +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) @@ -238,6 +425,54 @@ typedef unsigned long uintptr_t; char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap); #endif +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 5 || \ + RHEL_MAJOR -0 == 5 && RHEL_MINOR -0 < 10 || \ + RHEL_MAJOR -0 == 6 && RHEL_MINOR -0 < 1) +/* + * See also patch "mm: add vzalloc() and vzalloc_node() helpers" (commit + * e1ca7788dec6773b1a2bce51b7141948f2b8bccf). + */ +static inline void *vzalloc(unsigned long size) +{ + return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, + PAGE_KERNEL); +} +#endif + +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(BACKPORT_LINUX_WORKQUEUE_TO_2_6_19) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)) +static inline int cancel_delayed_work_sync(struct delayed_work *work) +{ + int res; + + res = cancel_delayed_work(work); + flush_scheduled_work(); + return res; +} +#else +/* + * While cancel_delayed_work_sync() has not been defined in the vanilla kernel + * 2.6.18 nor in 2.6.19 nor in RHEL/CentOS 5.0..5.5, a definition is available + * in RHEL/CentOS 5.6. Unfortunately that definition is incompatible with what + * we need. So define cancel_delayed_work() as a macro such that it overrides + * the RHEL/CentOS 5.6 inline function definition in . + */ +#define cancel_delayed_work_sync(work) \ +({ \ + int res; \ + \ + res = cancel_delayed_work((work)); \ + flush_scheduled_work(); \ + res; \ +}) +#endif +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) diff --git a/scst/include/scst.h b/scst/include/scst.h index 916625725..8d1940bd2 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -77,90 +77,6 @@ #include "scst_sgv.h" #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6) -#define set_cpus_allowed_ptr(p, new_mask) set_cpus_allowed((p), *(new_mask)) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) -#ifndef swap -#define swap(a, b) \ - do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) -static inline unsigned int queue_max_hw_sectors(struct request_queue *q) -{ - return q->max_hw_sectors; -} -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) -/* - * See also patch "kernel.h: add pr_warn for symmetry to dev_warn, - * netdev_warn" (commit fc62f2f19edf46c9bdbd1a54725b56b18c43e94f). - */ -#ifndef pr_warn -#define pr_warn pr_warning -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6) -/* - * See also patch "Add a dummy printk function for the maintenance of unused - * printks" (commit 12fdff3fc2483f906ae6404a6e8dcf2550310b6f). - */ -static inline __attribute__ ((format (printf, 1, 2))) -int no_printk(const char *s, ...) { return 0; } -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) -/* - * See also patch "sched: Fix softirq time accounting" (commit ID - * 75e1056f5c57050415b64cb761a3acc35d91f013). - */ -#ifndef in_serving_softirq -#define in_serving_softirq() in_softirq() -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6 || \ - RHEL_MAJOR -0 == 6 && RHEL_MINOR -0 < 1) -extern int hex_to_bin(char ch); -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) -/* - * See also "lib: hex2bin converts ascii hexadecimal string to binary" (commit - * dc88e46029486ed475c71fe1bb696d39511ac8fe). - */ -static inline void hex2bin(u8 *dst, const char *src, size_t count) -{ - while (count--) { - *dst = hex_to_bin(*src++) << 4; - *dst += hex_to_bin(*src++); - dst++; - } -} -#endif - -#ifndef __list_for_each -/* ToDo: cleanup when both are the same for all relevant kernels */ -#define __list_for_each list_for_each -#endif - -/* - * Returns true if entry is in its list. Entry must be deleted from the - * list by using list_del_init()! - */ -static inline bool list_entry_in_list(const struct list_head *entry) -{ - return !list_empty(entry); -} - #define SCST_INTERFACE_VERSION \ SCST_VERSION_STRING SCST_INTF_VER SCST_CONST_VERSION @@ -590,15 +506,6 @@ enum scst_exec_context { #endif -/************************************************************* - ** Kernel cache creation helper - *************************************************************/ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) -#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\ - sizeof(struct __struct), __alignof__(struct __struct),\ - (__flags), NULL, NULL) -#endif - /************************************************************* ** Valid_mask constants for scst_analyze_sense() *************************************************************/ @@ -618,14 +525,6 @@ enum scst_exec_context { ** T10-PI (DIF) support *************************************************************/ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) -struct t10_pi_tuple { - __be16 guard_tag; - __be16 app_tag; - __be32 ref_tag; -}; -#endif - /* * Defines where and how to deal with DIF tags. Can be OR'ed to get * multilevel checks @@ -3818,11 +3717,7 @@ static inline bool scst_cmd_atomic(struct scst_cmd *cmd) */ if (unlikely((in_atomic() || in_interrupt() || irqs_disabled()) && !res)) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) - printk(KERN_ERR "ERROR: atomic context and non-atomic cmd!\n"); -#else pr_err("ERROR: atomic context and non-atomic cmd!\n"); -#endif dump_stack(); cmd->atomic = 1; res = 1; @@ -4744,69 +4639,6 @@ static inline void scst_set_aen_delivery_status(struct scst_aen *aen, void scst_aen_done(struct scst_aen *aen); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) - -/* - * The macro's sg_page(), sg_virt(), sg_init_table(), sg_assign_page() and - * sg_set_page() have been introduced in the 2.6.24 kernel. The definitions - * below are backports of the 2.6.24 macro's for older kernels. There is one - * exception however: when compiling SCST on a system with a pre-2.6.24 kernel - * (e.g. RHEL 5.x) where the OFED kernel headers have been installed, do not - * define the backported macro's because OFED has already defined these. - */ - -static inline bool sg_is_chain(struct scatterlist *sg) -{ - return false; -} - -static inline struct scatterlist *sg_chain_ptr(struct scatterlist *sg) -{ - return NULL; -} - -#define sg_is_last(sg) false - -#ifndef sg_page -static inline struct page *sg_page(struct scatterlist *sg) -{ - return sg->page; -} -#endif - -static inline void *sg_virt(struct scatterlist *sg) -{ - return page_address(sg_page(sg)) + sg->offset; -} - -static inline void sg_mark_end(struct scatterlist *sg) -{ -} - -#ifndef __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ - -static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) -{ - memset(sgl, 0, sizeof(*sgl) * nents); -} - -static inline void sg_assign_page(struct scatterlist *sg, struct page *page) -{ - sg->page = page; -} - -static inline void sg_set_page(struct scatterlist *sg, struct page *page, - unsigned int len, unsigned int offset) -{ - sg_assign_page(sg, page); - sg->offset = offset; - sg->length = len; -} - -#endif /* __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ */ - -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) */ - static inline struct scatterlist *__sg_next_inline(struct scatterlist *sg) { sg++; @@ -4824,18 +4656,6 @@ static inline struct scatterlist *sg_next_inline(struct scatterlist *sg) return __sg_next_inline(sg); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) -#ifndef __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ - -#ifndef for_each_sg -/* See also commit 96b418c960af0d5c7185ff5c4af9376eb37ac9d3 */ -#define for_each_sg(sglist, sg, nr, __i) \ - for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next_inline(sg)) -#endif - -#endif /* __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ */ -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) */ - static inline void sg_clear(struct scatterlist *sg) { memset(sg, 0, sizeof(*sg)); @@ -5105,34 +4925,6 @@ static inline gfp_t scst_cmd_get_gfp_mask(struct scst_cmd *cmd) return cmd->cmd_gfp_mask; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(BACKPORT_LINUX_WORKQUEUE_TO_2_6_19) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)) -static inline int cancel_delayed_work_sync(struct delayed_work *work) -{ - int res; - - res = cancel_delayed_work(work); - flush_scheduled_work(); - return res; -} -#else -/* - * While cancel_delayed_work_sync() has not been defined in the vanilla kernel - * 2.6.18 nor in 2.6.19 nor in RHEL/CentOS 5.0..5.5, a definition is available - * in RHEL/CentOS 5.6. Unfortunately that definition is incompatible with what - * we need. So define cancel_delayed_work() as a macro such that it overrides - * the RHEL/CentOS 5.6 inline function definition in . - */ -#define cancel_delayed_work_sync(work) \ -({ \ - int res; \ - \ - res = cancel_delayed_work((work)); \ - flush_scheduled_work(); \ - res; \ -}) -#endif -#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) && defined(CONFIG_LOCKDEP) extern struct lockdep_map scst_suspend_dep_map; @@ -5585,21 +5377,6 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data, void (*done)(void *data, char *sense, int result, int resid)); #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 5 || \ - RHEL_MAJOR -0 == 5 && RHEL_MINOR -0 < 10 || \ - RHEL_MAJOR -0 == 6 && RHEL_MINOR -0 < 1) -/* - * See also patch "mm: add vzalloc() and vzalloc_node() helpers" (commit - * e1ca7788dec6773b1a2bce51b7141948f2b8bccf). - */ -static inline void *vzalloc(unsigned long size) -{ - return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, - PAGE_KERNEL); -} -#endif - int scst_get_file_mode(const char *path); bool scst_parent_dir_exists(const char *path); From b5c5a3eb7eb956cc0646d1aee1696fddb30e6b19 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 20:29:18 +0000 Subject: [PATCH 08/13] scst_vdisk: procfs build fix git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6560 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index e37f034f9..ade936cab 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -7356,26 +7356,6 @@ out: return res; } -static ssize_t vdisk_sysfs_sync_store(struct kobject *kobj, - struct kobj_attribute *attr, const char *buf, size_t count) -{ - struct scst_device *dev = - container_of(kobj, struct scst_device, dev_kobj); - struct scst_vdisk_dev *virt_dev = dev->dh_priv; - int res; - - if (virt_dev->nullio) - res = 0; - else if (virt_dev->blockio) - res = vdisk_blockio_flush(virt_dev->bdev, GFP_KERNEL, false, - NULL, false); - else - res = __vdisk_fsync_fileio(0, i_size_read(file_inode(virt_dev->fd)), - dev, NULL, virt_dev->fd); - - return res ? : count; -} - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) static int vdisk_create_bioset(struct scst_vdisk_dev *virt_dev) { @@ -8283,6 +8263,26 @@ out_e_unlock: #ifndef CONFIG_SCST_PROC +static ssize_t vdisk_sysfs_sync_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + struct scst_device *dev = + container_of(kobj, struct scst_device, dev_kobj); + struct scst_vdisk_dev *virt_dev = dev->dh_priv; + int res; + + if (virt_dev->nullio) + res = 0; + else if (virt_dev->blockio) + res = vdisk_blockio_flush(virt_dev->bdev, GFP_KERNEL, false, + NULL, false); + else + res = __vdisk_fsync_fileio(0, i_size_read(file_inode(virt_dev->fd)), + dev, NULL, virt_dev->fd); + + return res ? : count; +} + static int vcdrom_sysfs_process_filename_store(struct scst_sysfs_work_item *work) { int res; From 4a3ba74b67eb0e751e503238b758eba112d84d02 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 20:39:04 +0000 Subject: [PATCH 09/13] scst_local, procfs: Kernel v4.3 build fix. See also patch "fs/seq_file: convert int seq_vprint/seq_printf/etc... returns to void" (commit ID 6798a8caaf64fa68b9ab2044e070fe4545034e03). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6561 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst_local/scst_local.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index df7e3b862..eca959e8b 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -321,11 +321,12 @@ static int scst_local_proc_info(struct Scsi_Host *host, char *buffer, #else static int scst_local_show_info(struct seq_file *file, struct Scsi_Host *host) { - return seq_printf(file, "scst_local adapter driver, version " + seq_printf(file, "scst_local adapter driver, version " "%s [%s]\nAborts=%d, Device Resets=%d, Target Resets=%d\n", SCST_LOCAL_VERSION, scst_local_version_date, atomic_read(&num_aborts), atomic_read(&num_dev_resets), atomic_read(&num_target_resets)); + return 0; } #endif From 64984b964cbea226968c3df4a38dc60f1a6151c2 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 21:09:11 +0000 Subject: [PATCH 10/13] scstadmin.spec: procfs build fix git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6562 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scstadmin/scstadmin.spec.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scstadmin/scstadmin.spec.in b/scstadmin/scstadmin.spec.in index 0b40c1181..4c084d6dd 100644 --- a/scstadmin/scstadmin.spec.in +++ b/scstadmin/scstadmin.spec.in @@ -71,10 +71,12 @@ rm -f /usr/local/man/man5/scst.conf.5* %{_sbindir}/scstadmin %{perl_vendorlib}/SCST %{perl_vendorarch}/auto/SCST_SCST -%{_mandir}/man1/scstadmin.1* %{scstadmin_perl_installvendorman3dir}/SCST::SCST.3pm* +%if %([ "$(readlink scstadmin)" = scstadmin.sysfs ]; echo -n $((1-$?))) +%{_mandir}/man1/scstadmin.1* %{_mandir}/man5/scst.5* %{_mandir}/man5/scst.conf.5* +%endif %changelog * Fri Oct 04 2013 Bart Van Assche From 0a2cdd1f64c056965769f3e3a0df442e080a67d8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 21:11:06 +0000 Subject: [PATCH 11/13] iscsi-scst/kernel/Makefile.in-kernel: Sort file names alphabetically git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6563 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/Makefile.in-kernel | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iscsi-scst/kernel/Makefile.in-kernel b/iscsi-scst/kernel/Makefile.in-kernel index 4cedcb11f..aa63639b9 100644 --- a/iscsi-scst/kernel/Makefile.in-kernel +++ b/iscsi-scst/kernel/Makefile.in-kernel @@ -1,4 +1,12 @@ -iscsi-scst-y := iscsi.o nthread.o config.o digest.o \ - conn.o session.o target.o event.o param.o iscsit_transport.o +iscsi-scst-y += config.o +iscsi-scst-y += conn.o +iscsi-scst-y += digest.o +iscsi-scst-y += event.o +iscsi-scst-y += iscsi.o +iscsi-scst-y += iscsit_transport.o +iscsi-scst-y += nthread.o +iscsi-scst-y += param.o +iscsi-scst-y += session.o +iscsi-scst-y += target.o obj-$(CONFIG_SCST_ISCSI) += iscsi-scst.o isert-scst/ From 6fff27d6d838a28e7506fceb348c9f9ea99f0ac7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 21:18:00 +0000 Subject: [PATCH 12/13] nightly build: Update kernel versions git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6564 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- nightly/conf/nightly.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 184d9bb95..bdb6dc7a6 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,19 +3,19 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -4.2.4 \ -4.1.11-nc \ +4.2.5 \ +4.1.12-nc \ 4.0.9-nc \ 3.19.7-nc \ 3.18.19-nc \ 3.17.8-nc \ 3.16.7-nc \ 3.15.10-nc \ -3.14.55-nc \ +3.14.56-nc \ 3.13.11-nc \ 3.12.44-nc \ 3.11.10-nc \ -3.10.91-nc \ +3.10.92-nc \ 3.9.11-nc \ 3.8.13-nc \ 3.7.10-nc \ From f7c023f3efe4be3f6983a05a06fed8212476aa50 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Oct 2015 22:02:42 +0000 Subject: [PATCH 13/13] scst/README*: Remove trailing whitespace git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6565 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/README | 6 +++--- scst/README_in-tree | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scst/README b/scst/README index 679483bd6..73331a9ec 100644 --- a/scst/README +++ b/scst/README @@ -1601,7 +1601,7 @@ standard INQUIRY: [SPI: Clocking=0x0 QAS=0 IUS=0] length=66 (0x42) Peripheral device type: disk Vendor identification: SCST_FIO - Product identification: disk01 + Product identification: disk01 Product revision level: 300 Unit serial number: 27cddc71 @@ -1665,13 +1665,13 @@ Notes: 'prio_callout "/sbin/mpath_prio_alua /dev/%n"' instead of 'prio alua'. # multipath -ll -23237636464633731 dm-3 SCST_FIO,disk01 +23237636464633731 dm-3 SCST_FIO,disk01 size=1.0G features='3 queue_if_no_path pg_init_retries 50' hwhandler='1 alua' wp=rw |-+- policy='service-time 0' prio=1 status=active | `- 10:0:0:0 sdd 8:48 active ready running `-+- policy='service-time 0' prio=130 status=enabled `- 11:0:0:0 sde 8:64 active ready running -23133326137346538 dm-4 SCST_FIO,disk02 +23133326137346538 dm-4 SCST_FIO,disk02 size=1.0G features='3 queue_if_no_path pg_init_retries 50' hwhandler='1 alua' wp=rw |-+- policy='service-time 0' prio=130 status=active | `- 10:0:0:2 sdn 8:208 active ready running diff --git a/scst/README_in-tree b/scst/README_in-tree index 8bccc3b71..14255f774 100644 --- a/scst/README_in-tree +++ b/scst/README_in-tree @@ -1449,7 +1449,7 @@ standard INQUIRY: [SPI: Clocking=0x0 QAS=0 IUS=0] length=66 (0x42) Peripheral device type: disk Vendor identification: SCST_FIO - Product identification: disk01 + Product identification: disk01 Product revision level: 300 Unit serial number: 27cddc71 @@ -1513,13 +1513,13 @@ Notes: 'prio_callout "/sbin/mpath_prio_alua /dev/%n"' instead of 'prio alua'. # multipath -ll -23237636464633731 dm-3 SCST_FIO,disk01 +23237636464633731 dm-3 SCST_FIO,disk01 size=1.0G features='3 queue_if_no_path pg_init_retries 50' hwhandler='1 alua' wp=rw |-+- policy='service-time 0' prio=1 status=active | `- 10:0:0:0 sdd 8:48 active ready running `-+- policy='service-time 0' prio=130 status=enabled `- 11:0:0:0 sde 8:64 active ready running -23133326137346538 dm-4 SCST_FIO,disk02 +23133326137346538 dm-4 SCST_FIO,disk02 size=1.0G features='3 queue_if_no_path pg_init_retries 50' hwhandler='1 alua' wp=rw |-+- policy='service-time 0' prio=130 status=active | `- 10:0:0:2 sdn 8:208 active ready running