diff --git a/Makefile b/Makefile index ab5e5c5c3..68ab52e9f 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,8 @@ REVISION ?= $(shell if [ -e .svn ]; then \ fi) VERSION := $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h)$(REVISION)") DEBIAN_REVISION=1 +RPMTOPDIR ?= $(shell if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ + else echo $$PWD/rpmbuilddir; fi) help: @echo " all : make all" @@ -397,8 +399,7 @@ scst-dist-gzip: scst-rpm: name=scst && \ - rpmtopdir="$$(if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ - else echo $$PWD/rpmbuilddir; fi)" && \ + rpmtopdir=$(RPMTOPDIR) && \ $(MAKE) scst-dist-gzip && \ for d in BUILD RPMS SOURCES SPECS SRPMS; do \ mkdir -p $${rpmtopdir}/$$d; \ @@ -415,8 +416,7 @@ scst-rpm: scst-dkms-rpm: name=scst-dkms && \ - rpmtopdir="$$(if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ - else echo $$PWD/rpmbuilddir; fi)" && \ + rpmtopdir=$(RPMTOPDIR) && \ $(MAKE) scst-dist-gzip && \ for d in BUILD RPMS SOURCES SPECS SRPMS; do \ mkdir -p $${rpmtopdir}/$$d; \ diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index 200ffc9c2..5c27259d3 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -985,9 +985,6 @@ static void send_data_rsp(struct iscsi_cmnd *req, u8 status, int send_status) if (send_status) { TRACE_DBG("status %x", status); - EXTRACHECKS_BUG_ON((cmnd_hdr(req)->flags & - ISCSI_CMD_WRITE) != 0); - rsp_hdr->flags = ISCSI_FLG_FINAL | ISCSI_FLG_STATUS; rsp_hdr->cmd_status = status; diff --git a/scst/include/scst.h b/scst/include/scst.h index 0cb988777..118629bb6 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -66,66 +66,6 @@ #include #endif -#ifdef NOLOCKDEP_SUPPORTED -#define spin_lock_nolockdep(lock) \ - do { \ - current->nolockdep_call = 1; \ - spin_lock(lock); \ - current->nolockdep_call = 0; \ - } while (0) -#define spin_unlock_nolockdep(lock) \ - do { \ - current->nolockdep_call = 1; \ - spin_unlock(lock); \ - current->nolockdep_call = 0; \ - } while (0) -#define mutex_lock_nolockdep(lock) \ - do { \ - current->nolockdep_call = 1; \ - mutex_lock(lock); \ - current->nolockdep_call = 0; \ - } while (0) -#define mutex_unlock_nolockdep(lock) \ - do { \ - current->nolockdep_call = 1; \ - mutex_unlock(lock); \ - current->nolockdep_call = 0; \ - } while (0) -#define down_read_nolockdep(lock) \ - do { \ - current->nolockdep_call = 1; \ - down_read(lock); \ - current->nolockdep_call = 0; \ - } while (0) -#define up_read_nolockdep(lock) \ - do { \ - current->nolockdep_call = 1; \ - up_read(lock); \ - current->nolockdep_call = 0; \ - } while (0) -#define down_write_nolockdep(lock) \ - do { \ - current->nolockdep_call = 1; \ - down_write(lock); \ - current->nolockdep_call = 0; \ - } while (0) -#define up_write_nolockdep(lock) \ - do { \ - current->nolockdep_call = 1; \ - up_write(lock); \ - current->nolockdep_call = 0; \ - } while (0) -#else -#define spin_lock_nolockdep spin_lock -#define spin_unlock_nolockdep spin_unlock -#define mutex_lock_nolockdep mutex_lock -#define mutex_unlock_nolockdep mutex_unlock -#define down_read_nolockdep down_read -#define up_read_nolockdep up_read -#define down_write_nolockdep down_write -#define up_write_nolockdep up_write -#endif - #ifdef INSIDE_KERNEL_TREE #include #else @@ -2879,6 +2819,7 @@ struct scst_device { /* Device lock */ spinlock_t dev_lock ____cacheline_aligned_in_smp; + struct lock_class_key dev_lock_key; #ifdef CONFIG_SCST_PER_DEVICE_CMD_COUNT_LIMIT /* Number of commands associated with this device. */ @@ -3190,6 +3131,7 @@ struct scst_tgt_dev { }; spinlock_t tgt_dev_lock; /* per-session device lock */ + struct lock_class_key tgt_dev_key; /* List of UA's for this device, protected by tgt_dev_lock */ struct list_head UA_list; diff --git a/scst/kernel/README_nolockdep b/scst/kernel/README_nolockdep deleted file mode 100644 index 0ecc0fe03..000000000 --- a/scst/kernel/README_nolockdep +++ /dev/null @@ -1,17 +0,0 @@ -In some cases SCST needs to take multiple locks recursivly, e.g. to lock -all tgt_devs in a session. For this case SCST takes those locks in their -current sort order, e.g. by LUN for tgt_devs, then releases in the -opposite order. Unfortunately, lockdep complains on such actions as -recursive locking, then disables itself. The disabling itself action is -the most unpleasant one leading to lockdep being useless after this -point. - -Unfortunately, nested locking annotations can't help, because after -free, then alloc again, or after LUN change (in case of tgt_devs) order -of locks can change. - -So, SCST has a set of nolockdep-x.y patches together with "*_nolockdep" -locks to implement a way to annotate some lock and unlock actions as "no -lockdep", so lockdep will not track them. - -This is a debug aid useful only with lockdep enabled kernels. diff --git a/scst/kernel/nolockdep-3.10.patch b/scst/kernel/nolockdep-3.10.patch deleted file mode 100644 index 80bde3e07..000000000 --- a/scst/kernel/nolockdep-3.10.patch +++ /dev/null @@ -1,116 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2013-07-23 02:45:53 +0000 -+++ new/include/linux/lockdep.h 2013-07-23 03:31:57 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2013-07-23 02:45:53 +0000 -+++ new/include/linux/sched.h 2013-07-23 03:31:57 +0000 -@@ -1273,6 +1273,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/lockdep.c' ---- old/kernel/lockdep.c 2013-07-23 02:45:53 +0000 -+++ new/kernel/lockdep.c 2013-07-23 03:31:57 +0000 -@@ -3593,9 +3593,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3613,6 +3615,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3806,6 +3811,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3826,6 +3834,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2013-07-23 02:45:53 +0000 -+++ new/kernel/softirq.c 2013-07-23 03:31:57 +0000 -@@ -314,6 +314,18 @@ void irq_enter(void) - { - int cpu = smp_processor_id(); - -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif -+ - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -368,6 +380,18 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+ -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - } - - /* - diff --git a/scst/kernel/nolockdep-3.11.patch b/scst/kernel/nolockdep-3.11.patch deleted file mode 100644 index 9db7ca6b2..000000000 --- a/scst/kernel/nolockdep-3.11.patch +++ /dev/null @@ -1,116 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2013-09-28 00:14:38 +0000 -+++ new/include/linux/lockdep.h 2013-09-28 03:00:19 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2013-09-28 00:14:38 +0000 -+++ new/include/linux/sched.h 2013-09-28 03:00:19 +0000 -@@ -1266,6 +1266,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/lockdep.c' ---- old/kernel/lockdep.c 2013-09-28 00:14:38 +0000 -+++ new/kernel/lockdep.c 2013-09-28 03:00:19 +0000 -@@ -3593,9 +3593,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3613,6 +3615,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3806,6 +3811,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3826,6 +3834,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2013-09-28 00:14:38 +0000 -+++ new/kernel/softirq.c 2013-09-28 03:00:19 +0000 -@@ -312,6 +312,18 @@ void irq_enter(void) - { - int cpu = smp_processor_id(); - -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif -+ - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -366,6 +378,18 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+ -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - } - - /* - diff --git a/scst/kernel/nolockdep-3.12.patch b/scst/kernel/nolockdep-3.12.patch deleted file mode 100644 index 17dbdf83c..000000000 --- a/scst/kernel/nolockdep-3.12.patch +++ /dev/null @@ -1,116 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2013-11-30 00:34:22 +0000 -+++ new/include/linux/lockdep.h 2013-11-30 00:57:33 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2013-11-30 00:34:22 +0000 -+++ new/include/linux/sched.h 2013-11-30 00:57:33 +0000 -@@ -1265,6 +1265,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/lockdep.c' ---- old/kernel/lockdep.c 2013-11-30 00:34:22 +0000 -+++ new/kernel/lockdep.c 2013-11-30 00:57:33 +0000 -@@ -3593,9 +3593,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3613,6 +3615,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3806,6 +3811,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3826,6 +3834,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2013-11-30 00:34:22 +0000 -+++ new/kernel/softirq.c 2013-11-30 00:57:33 +0000 -@@ -312,6 +312,18 @@ void irq_enter(void) - { - int cpu = smp_processor_id(); - -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif -+ - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -375,6 +387,18 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+ -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - } - - /* - diff --git a/scst/kernel/nolockdep-3.13.patch b/scst/kernel/nolockdep-3.13.patch deleted file mode 100644 index 5a3bc886e..000000000 --- a/scst/kernel/nolockdep-3.13.patch +++ /dev/null @@ -1,116 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2014-01-30 00:25:53 +0000 -+++ new/include/linux/lockdep.h 2014-01-30 01:13:44 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2014-01-30 00:25:53 +0000 -+++ new/include/linux/sched.h 2014-01-30 01:13:44 +0000 -@@ -1277,6 +1277,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2014-01-30 00:25:53 +0000 -+++ new/kernel/locking/lockdep.c 2014-01-30 01:13:44 +0000 -@@ -3593,9 +3593,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3613,6 +3615,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3806,6 +3811,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3826,6 +3834,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2014-01-30 00:25:53 +0000 -+++ new/kernel/softirq.c 2014-01-30 01:13:44 +0000 -@@ -313,6 +313,18 @@ void irq_enter(void) - { - int cpu = smp_processor_id(); - -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif -+ - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -382,6 +394,18 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+ -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - } - - /* - diff --git a/scst/kernel/nolockdep-3.14.patch b/scst/kernel/nolockdep-3.14.patch deleted file mode 100644 index 2af0ee612..000000000 --- a/scst/kernel/nolockdep-3.14.patch +++ /dev/null @@ -1,114 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2014-04-17 22:02:06 +0000 -+++ new/include/linux/lockdep.h 2014-04-17 22:55:34 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2014-04-17 22:02:06 +0000 -+++ new/include/linux/sched.h 2014-04-17 22:55:34 +0000 -@@ -1404,6 +1404,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2014-04-17 22:02:06 +0000 -+++ new/kernel/locking/lockdep.c 2014-04-17 22:55:34 +0000 -@@ -3595,9 +3595,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3615,6 +3617,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3808,6 +3813,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3828,6 +3836,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2014-04-17 22:02:06 +0000 -+++ new/kernel/softirq.c 2014-04-17 22:55:34 +0000 -@@ -321,6 +321,17 @@ asmlinkage void do_softirq(void) - */ - void irq_enter(void) - { -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -389,6 +400,17 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - trace_hardirq_exit(); /* must be last! */ - } - - diff --git a/scst/kernel/nolockdep-3.15.patch b/scst/kernel/nolockdep-3.15.patch deleted file mode 100644 index c209c6e7d..000000000 --- a/scst/kernel/nolockdep-3.15.patch +++ /dev/null @@ -1,114 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2014-06-18 01:32:48 +0000 -+++ new/include/linux/lockdep.h 2014-06-18 01:45:33 +0000 -@@ -354,7 +354,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2014-06-18 01:32:48 +0000 -+++ new/include/linux/sched.h 2014-06-18 01:45:33 +0000 -@@ -1422,6 +1422,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2014-06-18 01:32:48 +0000 -+++ new/kernel/locking/lockdep.c 2014-06-18 01:45:33 +0000 -@@ -3592,9 +3592,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3612,6 +3614,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3805,6 +3810,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3825,6 +3833,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2014-06-18 01:32:48 +0000 -+++ new/kernel/softirq.c 2014-06-18 01:45:33 +0000 -@@ -322,6 +322,17 @@ asmlinkage __visible void do_softirq(voi - */ - void irq_enter(void) - { -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -390,6 +401,17 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - trace_hardirq_exit(); /* must be last! */ - } - - diff --git a/scst/kernel/nolockdep-3.16.patch b/scst/kernel/nolockdep-3.16.patch deleted file mode 100644 index 1dd204b46..000000000 --- a/scst/kernel/nolockdep-3.16.patch +++ /dev/null @@ -1,114 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2014-08-19 01:00:36 +0000 -+++ new/include/linux/lockdep.h 2014-08-19 01:18:25 +0000 -@@ -354,7 +354,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2014-08-19 01:00:36 +0000 -+++ new/include/linux/sched.h 2014-08-19 01:18:25 +0000 -@@ -1467,6 +1467,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2014-08-19 01:00:36 +0000 -+++ new/kernel/locking/lockdep.c 2014-08-19 01:18:25 +0000 -@@ -3592,9 +3592,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3612,6 +3614,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3805,6 +3810,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3825,6 +3833,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2014-08-19 01:00:36 +0000 -+++ new/kernel/softirq.c 2014-08-19 01:18:25 +0000 -@@ -320,6 +320,17 @@ asmlinkage __visible void do_softirq(voi - */ - void irq_enter(void) - { -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -388,6 +399,17 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - trace_hardirq_exit(); /* must be last! */ - } - - diff --git a/scst/kernel/nolockdep-3.17.patch b/scst/kernel/nolockdep-3.17.patch deleted file mode 100644 index 50be59dbf..000000000 --- a/scst/kernel/nolockdep-3.17.patch +++ /dev/null @@ -1,114 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2014-11-21 03:17:49 +0000 -+++ new/include/linux/lockdep.h 2014-11-21 03:51:56 +0000 -@@ -354,7 +354,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2014-11-21 03:17:49 +0000 -+++ new/include/linux/sched.h 2014-11-21 03:51:56 +0000 -@@ -1462,6 +1462,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2014-11-21 03:17:49 +0000 -+++ new/kernel/locking/lockdep.c 2014-11-21 03:51:56 +0000 -@@ -3594,9 +3594,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3614,6 +3616,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3807,6 +3812,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3827,6 +3835,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2014-11-21 03:17:49 +0000 -+++ new/kernel/softirq.c 2014-11-21 03:51:56 +0000 -@@ -320,6 +320,17 @@ asmlinkage __visible void do_softirq(voi - */ - void irq_enter(void) - { -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -388,6 +399,17 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - trace_hardirq_exit(); /* must be last! */ - } - - diff --git a/scst/kernel/nolockdep-3.5.patch b/scst/kernel/nolockdep-3.5.patch deleted file mode 100644 index d1a65df82..000000000 --- a/scst/kernel/nolockdep-3.5.patch +++ /dev/null @@ -1,116 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2012-08-08 02:57:29 +0000 -+++ new/include/linux/lockdep.h 2012-08-28 21:26:26 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2012-08-08 02:57:29 +0000 -+++ new/include/linux/sched.h 2012-08-28 22:49:36 +0000 -@@ -1454,6 +1454,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/lockdep.c' ---- old/kernel/lockdep.c 2012-08-08 02:57:29 +0000 -+++ new/kernel/lockdep.c 2012-08-28 23:02:47 +0000 -@@ -3547,9 +3547,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3567,6 +3569,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3760,6 +3765,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3780,6 +3788,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2012-08-08 02:57:29 +0000 -+++ new/kernel/softirq.c 2012-08-28 23:23:07 +0000 -@@ -296,6 +296,18 @@ void irq_enter(void) - { - int cpu = smp_processor_id(); - -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif -+ - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -344,6 +356,18 @@ void irq_exit(void) - #endif - rcu_irq_exit(); - sched_preempt_enable_no_resched(); -+ -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - } - - /* - diff --git a/scst/kernel/nolockdep-3.6.patch b/scst/kernel/nolockdep-3.6.patch deleted file mode 100644 index e0e31f63b..000000000 --- a/scst/kernel/nolockdep-3.6.patch +++ /dev/null @@ -1,116 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2012-10-01 18:39:34 +0000 -+++ new/include/linux/lockdep.h 2012-10-01 22:12:06 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2012-10-01 18:39:34 +0000 -+++ new/include/linux/sched.h 2012-10-01 22:12:06 +0000 -@@ -1462,6 +1462,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/lockdep.c' ---- old/kernel/lockdep.c 2012-10-01 18:39:34 +0000 -+++ new/kernel/lockdep.c 2012-10-01 22:12:06 +0000 -@@ -3547,9 +3547,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3567,6 +3569,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3760,6 +3765,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3780,6 +3788,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2012-10-01 18:39:34 +0000 -+++ new/kernel/softirq.c 2012-10-01 22:12:06 +0000 -@@ -305,6 +305,18 @@ void irq_enter(void) - { - int cpu = smp_processor_id(); - -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif -+ - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -353,6 +365,18 @@ void irq_exit(void) - #endif - rcu_irq_exit(); - sched_preempt_enable_no_resched(); -+ -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - } - - /* - diff --git a/scst/kernel/nolockdep-3.7.patch b/scst/kernel/nolockdep-3.7.patch deleted file mode 100644 index 4dd9b402b..000000000 --- a/scst/kernel/nolockdep-3.7.patch +++ /dev/null @@ -1,116 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2012-12-17 19:41:04 +0000 -+++ new/include/linux/lockdep.h 2012-12-17 23:12:00 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2012-12-17 19:41:04 +0000 -+++ new/include/linux/sched.h 2012-12-17 23:12:00 +0000 -@@ -1418,6 +1418,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/lockdep.c' ---- old/kernel/lockdep.c 2012-12-17 19:41:04 +0000 -+++ new/kernel/lockdep.c 2012-12-17 23:12:00 +0000 -@@ -3586,9 +3586,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3606,6 +3608,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3799,6 +3804,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3819,6 +3827,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2012-12-17 19:41:04 +0000 -+++ new/kernel/softirq.c 2012-12-17 23:12:00 +0000 -@@ -306,6 +306,18 @@ void irq_enter(void) - { - int cpu = smp_processor_id(); - -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif -+ - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -354,6 +366,18 @@ void irq_exit(void) - #endif - rcu_irq_exit(); - sched_preempt_enable_no_resched(); -+ -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - } - - /* - diff --git a/scst/kernel/nolockdep-3.8.patch b/scst/kernel/nolockdep-3.8.patch deleted file mode 100644 index f785d1f92..000000000 --- a/scst/kernel/nolockdep-3.8.patch +++ /dev/null @@ -1,116 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2013-02-22 21:12:31 +0000 -+++ new/include/linux/lockdep.h 2013-02-23 00:19:37 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2013-02-22 21:12:31 +0000 -+++ new/include/linux/sched.h 2013-02-23 00:19:37 +0000 -@@ -1466,6 +1466,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/lockdep.c' ---- old/kernel/lockdep.c 2013-02-22 21:12:31 +0000 -+++ new/kernel/lockdep.c 2013-02-23 00:19:37 +0000 -@@ -3586,9 +3586,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3606,6 +3608,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3799,6 +3804,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3819,6 +3827,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2013-02-22 21:12:31 +0000 -+++ new/kernel/softirq.c 2013-02-23 00:19:37 +0000 -@@ -306,6 +306,18 @@ void irq_enter(void) - { - int cpu = smp_processor_id(); - -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif -+ - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -354,6 +366,18 @@ void irq_exit(void) - #endif - rcu_irq_exit(); - sched_preempt_enable_no_resched(); -+ -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - } - - /* - diff --git a/scst/kernel/nolockdep-3.9.patch b/scst/kernel/nolockdep-3.9.patch deleted file mode 100644 index 42dde79e0..000000000 --- a/scst/kernel/nolockdep-3.9.patch +++ /dev/null @@ -1,116 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2013-05-11 05:39:14 +0000 -+++ new/include/linux/lockdep.h 2013-05-18 03:43:23 +0000 -@@ -355,7 +355,7 @@ extern void lockdep_set_current_reclaim_ - extern void lockdep_clear_current_reclaim_state(void); - extern void lockdep_trace_alloc(gfp_t mask); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2013-05-11 05:39:14 +0000 -+++ new/include/linux/sched.h 2013-05-18 03:43:23 +0000 -@@ -1438,6 +1438,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/lockdep.c' ---- old/kernel/lockdep.c 2013-05-11 05:39:14 +0000 -+++ new/kernel/lockdep.c 2013-05-18 03:43:23 +0000 -@@ -3591,9 +3591,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3611,6 +3613,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3804,6 +3809,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3824,6 +3832,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2013-05-11 05:39:14 +0000 -+++ new/kernel/softirq.c 2013-05-18 03:43:23 +0000 -@@ -307,6 +307,18 @@ void irq_enter(void) - { - int cpu = smp_processor_id(); - -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif -+ - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -352,6 +364,18 @@ void irq_exit(void) - tick_nohz_irq_exit(); - #endif - rcu_irq_exit(); -+ -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - } - - /* - diff --git a/scst/kernel/nolockdep-4.10.patch b/scst/kernel/nolockdep-4.10.patch deleted file mode 100644 index de8440968..000000000 --- a/scst/kernel/nolockdep-4.10.patch +++ /dev/null @@ -1,114 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2017-05-04 04:27:46 +0000 -+++ new/include/linux/lockdep.h 2017-05-04 04:39:00 +0000 -@@ -373,7 +373,7 @@ extern struct pin_cookie lock_pin_lock(s - extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie); - extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2017-05-04 04:27:46 +0000 -+++ new/include/linux/sched.h 2017-05-04 04:39:00 +0000 -@@ -1789,6 +1789,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2017-05-04 04:27:46 +0000 -+++ new/kernel/locking/lockdep.c 2017-05-04 04:39:00 +0000 -@@ -3745,9 +3745,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3765,6 +3767,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -4013,6 +4018,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -4033,6 +4041,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2017-05-04 04:27:46 +0000 -+++ new/kernel/softirq.c 2017-05-04 04:39:00 +0000 -@@ -335,6 +335,17 @@ asmlinkage __visible void do_softirq(voi - */ - void irq_enter(void) - { -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -406,6 +417,17 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - trace_hardirq_exit(); /* must be last! */ - } - - diff --git a/scst/kernel/nolockdep-4.11.patch b/scst/kernel/nolockdep-4.11.patch deleted file mode 100644 index 21c312e34..000000000 --- a/scst/kernel/nolockdep-4.11.patch +++ /dev/null @@ -1,114 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2017-06-02 03:24:57 +0000 -+++ new/include/linux/lockdep.h 2017-06-02 03:31:44 +0000 -@@ -373,7 +373,7 @@ extern struct pin_cookie lock_pin_lock(s - extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie); - extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2017-06-02 03:24:57 +0000 -+++ new/include/linux/sched.h 2017-06-02 03:31:44 +0000 -@@ -808,6 +808,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2017-06-02 03:24:57 +0000 -+++ new/kernel/locking/lockdep.c 2017-06-02 03:31:44 +0000 -@@ -3754,9 +3754,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3774,6 +3776,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -4022,6 +4027,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -4042,6 +4050,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2017-06-02 03:24:57 +0000 -+++ new/kernel/softirq.c 2017-06-02 03:31:44 +0000 -@@ -335,6 +335,17 @@ asmlinkage __visible void do_softirq(voi - */ - void irq_enter(void) - { -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -406,6 +417,17 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - trace_hardirq_exit(); /* must be last! */ - } - - diff --git a/scst/kernel/nolockdep-4.13.patch b/scst/kernel/nolockdep-4.13.patch deleted file mode 100644 index 3aee8ffec..000000000 --- a/scst/kernel/nolockdep-4.13.patch +++ /dev/null @@ -1,114 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2017-10-03 21:12:19 +0000 -+++ new/include/linux/lockdep.h 2017-10-03 21:22:27 +0000 -@@ -375,7 +375,7 @@ extern struct pin_cookie lock_pin_lock(s - extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie); - extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2017-10-03 21:12:19 +0000 -+++ new/include/linux/sched.h 2017-10-03 21:22:27 +0000 -@@ -844,6 +844,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2017-10-03 21:12:19 +0000 -+++ new/kernel/locking/lockdep.c 2017-10-03 21:22:27 +0000 -@@ -3847,9 +3847,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3867,6 +3869,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -4097,6 +4102,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -4117,6 +4125,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2017-10-03 21:12:19 +0000 -+++ new/kernel/softirq.c 2017-10-03 21:22:27 +0000 -@@ -335,6 +335,17 @@ asmlinkage __visible void do_softirq(voi - */ - void irq_enter(void) - { -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -406,6 +417,17 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - trace_hardirq_exit(); /* must be last! */ - } - - diff --git a/scst/kernel/nolockdep-4.6.patch b/scst/kernel/nolockdep-4.6.patch deleted file mode 100644 index 0d82f1a93..000000000 --- a/scst/kernel/nolockdep-4.6.patch +++ /dev/null @@ -1,114 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2016-06-17 23:23:35 +0000 -+++ new/include/linux/lockdep.h 2016-06-17 23:38:32 +0000 -@@ -359,7 +359,7 @@ extern void lockdep_trace_alloc(gfp_t ma - extern void lock_pin_lock(struct lockdep_map *lock); - extern void lock_unpin_lock(struct lockdep_map *lock); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2016-06-17 23:23:35 +0000 -+++ new/include/linux/sched.h 2016-06-17 23:38:32 +0000 -@@ -1649,6 +1649,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2016-06-17 23:23:35 +0000 -+++ new/kernel/locking/lockdep.c 2016-06-17 23:38:32 +0000 -@@ -3700,9 +3700,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3720,6 +3722,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3948,6 +3953,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -3968,6 +3976,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2016-06-17 23:23:35 +0000 -+++ new/kernel/softirq.c 2016-06-17 23:38:32 +0000 -@@ -324,6 +324,17 @@ asmlinkage __visible void do_softirq(voi - */ - void irq_enter(void) - { -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -392,6 +403,17 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - trace_hardirq_exit(); /* must be last! */ - } - - diff --git a/scst/kernel/nolockdep-4.9.patch b/scst/kernel/nolockdep-4.9.patch deleted file mode 100644 index 1f2158684..000000000 --- a/scst/kernel/nolockdep-4.9.patch +++ /dev/null @@ -1,114 +0,0 @@ -=== modified file 'include/linux/lockdep.h' ---- old/include/linux/lockdep.h 2017-02-02 22:58:27 +0000 -+++ new/include/linux/lockdep.h 2017-02-02 23:07:50 +0000 -@@ -364,7 +364,7 @@ extern struct pin_cookie lock_pin_lock(s - extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie); - extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie); - --# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, -+# define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .nolockdep_call = 0, - - #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) - - -=== modified file 'include/linux/sched.h' ---- old/include/linux/sched.h 2017-02-02 22:58:27 +0000 -+++ new/include/linux/sched.h 2017-02-02 23:07:50 +0000 -@@ -1746,6 +1746,9 @@ struct task_struct { - # define MAX_LOCK_DEPTH 48UL - u64 curr_chain_key; - int lockdep_depth; -+# define NOLOCKDEP_SUPPORTED 1 -+ unsigned int nolockdep_call:1; -+ unsigned int nolockdep_call_irq_saved:1; - unsigned int lockdep_recursion; - struct held_lock held_locks[MAX_LOCK_DEPTH]; - gfp_t lockdep_reclaim_gfp; - -=== modified file 'kernel/locking/lockdep.c' ---- old/kernel/locking/lockdep.c 2017-02-02 22:58:27 +0000 -+++ new/kernel/locking/lockdep.c 2017-02-02 23:07:50 +0000 -@@ -3741,9 +3741,11 @@ void lock_acquire(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); -- - current->lockdep_recursion = 1; - trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); - __lock_acquire(lock, subclass, trylock, read, check, -@@ -3761,6 +3763,9 @@ void lock_release(struct lockdep_map *lo - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -4009,6 +4014,9 @@ void lock_contended(struct lockdep_map * - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; -@@ -4029,6 +4037,9 @@ void lock_acquired(struct lockdep_map *l - if (unlikely(current->lockdep_recursion)) - return; - -+ if (unlikely(current->nolockdep_call)) -+ return; -+ - raw_local_irq_save(flags); - check_flags(flags); - current->lockdep_recursion = 1; - -=== modified file 'kernel/softirq.c' ---- old/kernel/softirq.c 2017-02-02 22:58:27 +0000 -+++ new/kernel/softirq.c 2017-02-02 23:07:50 +0000 -@@ -335,6 +335,17 @@ asmlinkage __visible void do_softirq(voi - */ - void irq_enter(void) - { -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call) { -+ current->nolockdep_call_irq_saved = 1; -+ current->nolockdep_call = 0; -+ } -+ local_irq_restore(flags); -+ } -+#endif - rcu_irq_enter(); - if (is_idle_task(current) && !in_interrupt()) { - /* -@@ -406,6 +417,17 @@ void irq_exit(void) - - tick_irq_exit(); - rcu_irq_exit(); -+#ifdef CONFIG_LOCKDEP -+ if (unlikely(current->nolockdep_call_irq_saved)) { -+ unsigned long flags; -+ local_irq_save(flags); -+ if (current->nolockdep_call_irq_saved) { -+ current->nolockdep_call_irq_saved = 0; -+ current->nolockdep_call = 1; -+ } -+ local_irq_restore(flags); -+ } -+#endif - trace_hardirq_exit(); /* must be last! */ - } - - diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index afaf0cce5..6d2171274 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -3190,7 +3190,8 @@ static void fileio_async_complete(struct kiocb *iocb, long ret, long ret2) struct vdisk_cmd_params *p = container_of(iocb, typeof(*p), async.iocb); struct scst_cmd *cmd = p->cmd; - WARN_ON_ONCE(ret >= 0 && ret != cmd->bufflen); + if (ret >= 0 && ret != cmd->bufflen) + scst_set_resp_data_len(cmd, ret); if (ret < 0 && scst_cmd_get_data_direction(cmd) & SCST_DATA_WRITE) { @@ -3211,8 +3212,6 @@ static void fileio_async_complete(struct kiocb *iocb, long ret, long ret2) } else { scst_set_busy(cmd); } - } else { - WARN_ON_ONCE(ret != scst_cmd_get_data_len(cmd)); } cmd->completed = 1; cmd->scst_cmd_done(cmd, SCST_CMD_STATE_DEFAULT, SCST_CONTEXT_SAME); @@ -3262,7 +3261,7 @@ static enum compl_status_e fileio_exec_async(struct vdisk_cmd_params *p) length = scst_get_buf_next(cmd, &address); } - WARN_ON_ONCE(sg_cnt != scst_get_buf_count(cmd)); + WARN_ON_ONCE(sg_cnt != cmd->sg_cnt); #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) iov_iter_kvec(&iter, dir, p->async.kvec, sg_cnt, total); diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index 2fe02a287..344b69e37 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -1783,7 +1783,7 @@ bool scst_cm_check_block_all_devs(struct scst_cmd *cmd) #if !defined(__CHECKER__) list_for_each_entry(e, &d->cm_sorted_devs_list, cm_sorted_devs_list_entry) { - spin_lock_nolockdep(&e->cm_fcmd->dev->dev_lock); + spin_lock(&e->cm_fcmd->dev->dev_lock); } #endif @@ -1812,7 +1812,7 @@ bool scst_cm_check_block_all_devs(struct scst_cmd *cmd) #if !defined(__CHECKER__) list_for_each_entry_reverse(e, &d->cm_sorted_devs_list, cm_sorted_devs_list_entry) { - spin_unlock_nolockdep(&e->cm_fcmd->dev->dev_lock); + spin_unlock(&e->cm_fcmd->dev->dev_lock); } #endif @@ -1856,30 +1856,16 @@ out_unlock: return; } -static void scst_cm_del_free_list_id(struct scst_cm_list_id *l, bool locked) +static void scst_cm_del_free_list_id(struct scst_cm_list_id *l) { - unsigned long flags = 0; - TRACE_ENTRY(); TRACE_DBG("Freeing list id %p", l); -#if !defined(__CHECKER__) - if (!locked) - spin_lock_irqsave(&scst_cm_lock, flags); -#endif - -#ifdef CONFIG_SMP - EXTRACHECKS_BUG_ON(!spin_is_locked(&scst_cm_lock)); -#endif + lockdep_assert_held(&scst_cm_lock); list_del(&l->sess_cm_list_id_entry); -#if !defined(__CHECKER__) - if (!locked) - spin_unlock_irqrestore(&scst_cm_lock, flags); -#endif - kfree(l); TRACE_EXIT(); @@ -1916,7 +1902,7 @@ static void scst_cm_sched_del_list_id(struct scst_cmd *ec_cmd) if (test_bit(SCST_CMD_ABORTED, &ec_cmd->cmd_flags) || l->cm_can_be_immed_free) { TRACE_DBG("List id %p can be immed freed", l); - scst_cm_del_free_list_id(l, true); + scst_cm_del_free_list_id(l); spin_unlock_irqrestore(&scst_cm_lock, flags); goto out; } @@ -1960,7 +1946,7 @@ static struct scst_cm_list_id *scst_cm_add_list_id(struct scst_cmd *cmd, list_for_each_entry(l, &sess->sess_cm_list_id_list, sess_cm_list_id_entry) { if (l->cm_lid == list_id) { if (l->cm_list_id_state == SCST_CM_LIST_ID_STATE_PENDING_FREE) { - scst_cm_del_free_list_id(l, true); + scst_cm_del_free_list_id(l); break; } else { TRACE_DBG("List id %d already exists", list_id); @@ -2013,7 +1999,7 @@ void sess_cm_list_id_cleanup_work_fn(struct work_struct *work) if (l->cm_list_id_state != SCST_CM_LIST_ID_STATE_PENDING_FREE) break; if (time_after_eq(cur_time, l->cm_time_to_free)) - scst_cm_del_free_list_id(l, true); + scst_cm_del_free_list_id(l); else { TRACE_DBG("Reschedule pending free list ids cleanup"); schedule_delayed_work(&sess->sess_cm_list_id_cleanup_work, @@ -2038,7 +2024,7 @@ void scst_cm_free_pending_list_ids(struct scst_session *sess) list_for_each_entry_safe(l, t, &sess->sess_cm_list_id_list, sess_cm_list_id_entry) { TRACE_DBG("List id %p, state %d", l, l->cm_list_id_state); if (l->cm_list_id_state == SCST_CM_LIST_ID_STATE_PENDING_FREE) - scst_cm_del_free_list_id(l, true); + scst_cm_del_free_list_id(l); } spin_unlock_irq(&scst_cm_lock); @@ -2083,7 +2069,7 @@ static void scst_cm_copy_status(struct scst_cmd *cmd) put_unaligned_be32(l->cm_written_size >> 10, &tbuf[8]); if (l->cm_done) - scst_cm_del_free_list_id(l, true); + scst_cm_del_free_list_id(l); } l = NULL; /* after unlock it can be immediately get dead */ @@ -2172,7 +2158,7 @@ static void scst_cm_failed_seg_details(struct scst_cmd *cmd) memcpy(&tbuf[60], l->cm_sense, l->cm_sense_len); if (l->cm_can_be_immed_free && l->cm_done) - scst_cm_del_free_list_id(l, true); + scst_cm_del_free_list_id(l); } skip: @@ -3353,6 +3339,7 @@ int scst_cm_parse_descriptors(struct scst_cmd *ec_cmd) struct scst_cm_ec_cmd_priv *p; int tgt_cnt, seg_cnt, i, offs, t; struct scst_cm_tgt_descr *tgt_descrs; + unsigned long flags; TRACE_ENTRY(); @@ -3560,8 +3547,11 @@ int scst_cm_parse_descriptors(struct scst_cmd *ec_cmd) kfree(tgt_descrs); out_del_put: - if (plist_id != NULL) - scst_cm_del_free_list_id(plist_id, false); + if (plist_id != NULL) { + spin_lock_irqsave(&scst_cm_lock, flags); + scst_cm_del_free_list_id(plist_id); + spin_unlock_irqrestore(&scst_cm_lock, flags); + } out_put: scst_put_buf_full(ec_cmd, buf); @@ -3577,8 +3567,11 @@ out_free_tgt_descr: kfree(tgt_descrs); out_del_abn_put: - if (plist_id != NULL) - scst_cm_del_free_list_id(plist_id, false); + if (plist_id != NULL) { + spin_lock_irqsave(&scst_cm_lock, flags); + scst_cm_del_free_list_id(plist_id); + spin_unlock_irqrestore(&scst_cm_lock, flags); + } out_abn_put: scst_put_buf_full(ec_cmd, buf); diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 4333a9489..fca89fd62 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -2666,8 +2666,8 @@ static void scst_queue_report_luns_changed_UA(struct scst_session *sess, list_for_each_entry_rcu(tgt_dev, head, sess_tgt_dev_list_entry) { - /* Lockdep triggers here a false positive.. */ - spin_lock_nolockdep(&tgt_dev->tgt_dev_lock); + /* Lockdep reports a false positive here before v5.1. */ + spin_lock(&tgt_dev->tgt_dev_lock); } } #endif @@ -2698,7 +2698,7 @@ static void scst_queue_report_luns_changed_UA(struct scst_session *sess, list_for_each_entry_rcu(tgt_dev, head, sess_tgt_dev_list_entry) { - spin_unlock_nolockdep(&tgt_dev->tgt_dev_lock); + spin_unlock(&tgt_dev->tgt_dev_lock); } } #endif @@ -4213,6 +4213,8 @@ static void scst_free_device(struct work_struct *work) scst_pr_cleanup(dev); + lockdep_unregister_key(&dev->dev_lock_key); + kfree(dev->virt_name); percpu_ref_exit(&dev->refcnt); kmem_cache_free(scst_dev_cachep, dev); @@ -4256,6 +4258,8 @@ int scst_alloc_device(gfp_t gfp_mask, int nodeid, struct scst_device **out_dev) #endif scst_init_mem_lim(&dev->dev_mem_lim); spin_lock_init(&dev->dev_lock); + lockdep_register_key(&dev->dev_lock_key); + lockdep_set_class(&dev->dev_lock, &dev->dev_lock_key); INIT_LIST_HEAD(&dev->dev_exec_cmd_list); INIT_LIST_HEAD(&dev->blocked_cmd_list); INIT_LIST_HEAD(&dev->dev_tgt_dev_list); @@ -5398,6 +5402,8 @@ static int scst_alloc_add_tgt_dev(struct scst_session *sess, dev->virt_name, (unsigned long long)tgt_dev->lun); spin_lock_init(&tgt_dev->tgt_dev_lock); + lockdep_register_key(&tgt_dev->tgt_dev_key); + lockdep_set_class(&tgt_dev->tgt_dev_lock, &tgt_dev->tgt_dev_key); INIT_LIST_HEAD(&tgt_dev->UA_list); scst_init_order_data(&tgt_dev->tgt_dev_order_data); @@ -5496,6 +5502,8 @@ out_dec_free: out_free_ua: scst_free_all_UA(tgt_dev); + lockdep_unregister_key(&tgt_dev->tgt_dev_key); + kmem_cache_free(scst_tgtd_cachep, tgt_dev); goto out; } @@ -5574,6 +5582,8 @@ static void scst_free_tgt_dev(struct scst_tgt_dev *tgt_dev) scst_tgt_dev_stop_threads(tgt_dev); + lockdep_unregister_key(&tgt_dev->tgt_dev_key); + kmem_cache_free(scst_tgtd_cachep, tgt_dev); percpu_ref_put(&dev->refcnt); @@ -12971,8 +12981,11 @@ again: list_for_each_entry_rcu(tgt_dev, head, sess_tgt_dev_list_entry) { - /* Lockdep triggers here a false positive.. */ - spin_lock_nolockdep(&tgt_dev->tgt_dev_lock); + /* + * Lockdep reports a false positive here before + * kernel version v5.1. + */ + spin_lock(&tgt_dev->tgt_dev_lock); } } #endif @@ -13046,7 +13059,7 @@ out_unlock: list_for_each_entry_rcu(tgt_dev, head, sess_tgt_dev_list_entry) { - spin_unlock_nolockdep(&tgt_dev->tgt_dev_lock); + spin_unlock(&tgt_dev->tgt_dev_lock); } } rcu_read_unlock(); diff --git a/scstadmin/Makefile b/scstadmin/Makefile index 5ed1e3ac7..b0aa0a05f 100644 --- a/scstadmin/Makefile +++ b/scstadmin/Makefile @@ -67,6 +67,9 @@ DEFAULTDIR := $(shell if [ -f /etc/gentoo-release ]; then \ echo /etc/default; \ fi) +RPMTOPDIR ?= $(shell if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ + else echo $$PWD/rpmbuilddir; fi) + all: cd $(SCSTADMIN_DIR) && $(MAKE) $@ @@ -139,8 +142,7 @@ dist-gzip: rpm: name=$(shell basename $$PWD) && \ - rpmtopdir="$$(if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ - else echo $$PWD/rpmbuilddir; fi)" && \ + rpmtopdir=$(RPMTOPDIR) && \ $(MAKE) dist-gzip && \ for d in BUILD RPMS SOURCES SPECS SRPMS; do \ mkdir -p $${rpmtopdir}/$$d; \