File iscsitarget-kernel-3.5.patch of Package iscsitarget

From: 	Arne Redlich <arne.redlich@googlemail.com>

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
 Makefile                     |    4 ++++
 kernel/wthread.c             |    5 ++++-
 patches/compat-3.2-3.4.patch |   22 ++++++++++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 patches/compat-3.2-3.4.patch

diff --git a/Makefile b/Makefile
index 996f645..a3dd653 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,10 @@ kver_lk = $(shell [ `echo $(KVER) | egrep $(1)` ] && echo 1 || echo 0)
 # base first the earlier patch sets will not need to be modified.
 #
 
+ifeq ($(call kver_le,3,4,0),1)
+	PATCHES := $(PATCHES) compat-3.2-3.4.patch
+endif
+
 ifeq ($(call kver_le,3,2,0),1)
 	PATCHES := $(PATCHES) compat-2.6.39-3.2.patch
 endif
diff --git a/kernel/wthread.c b/kernel/wthread.c
index 940de9d..55d7321 100644
--- a/kernel/wthread.c
+++ b/kernel/wthread.c
@@ -65,13 +65,16 @@ static int worker_thread(void *arg)
 	struct worker_thread_info *info = wt->w_info;
 	struct iscsi_cmnd *cmnd;
 	struct iscsi_conn *conn;
+
 	DECLARE_WAITQUEUE(wait, current);
 
 	if (current->io_context)
 		put_io_context(current->io_context);
 
-	if (!(current->io_context = ioc_task_link(info->wthread_ioc)))
+	if (!info->wthread_ioc)
 		info->wthread_ioc = get_task_io_context(current, GFP_KERNEL, -1);
+	ioc_task_link(info->wthread_ioc);
+	current->io_context = info->wthread_ioc;
 
 	add_wait_queue(&info->wthread_sleep, &wait);
 
diff --git a/patches/compat-3.2-3.4.patch b/patches/compat-3.2-3.4.patch
new file mode 100644
index 0000000..09160ea
--- /dev/null
+++ b/patches/compat-3.2-3.4.patch
@@ -0,0 +1,22 @@
+diff --git b/kernel/wthread.c a/kernel/wthread.c
+index 55d7321..940de9d 100644
+--- b/kernel/wthread.c
++++ a/kernel/wthread.c
+@@ -65,16 +65,13 @@ static int worker_thread(void *arg)
+ 	struct worker_thread_info *info = wt->w_info;
+ 	struct iscsi_cmnd *cmnd;
+ 	struct iscsi_conn *conn;
+-
+ 	DECLARE_WAITQUEUE(wait, current);
+ 
+ 	if (current->io_context)
+ 		put_io_context(current->io_context);
+ 
+-	if (!info->wthread_ioc)
++	if (!(current->io_context = ioc_task_link(info->wthread_ioc)))
+ 		info->wthread_ioc = get_task_io_context(current, GFP_KERNEL, -1);
+-	ioc_task_link(info->wthread_ioc);
+-	current->io_context = info->wthread_ioc;
+ 
+ 	add_wait_queue(&info->wthread_sleep, &wait);
+ 
-- 
1.7.9.5
openSUSE Build Service is sponsored by