[Pkg-iscsi-maintainers] [iscsitarget] 01/07: Imported Upstream version 1.4.20.3+svn499
Ritesh Raj Sarraf
rrs at moszumanska.debian.org
Thu May 8 13:15:54 UTC 2014
This is an automated email from the git hooks/post-receive script.
rrs pushed a commit to branch master
in repository iscsitarget.
commit afd5a747c62d021b6603b5a275d38c9bc31c55ed
Author: Ritesh Raj Sarraf <rrs at debian.org>
Date: Sun May 4 14:18:48 2014 +0530
Imported Upstream version 1.4.20.3+svn499
---
Makefile | 10 +++++++---
kernel/conn.c | 2 +-
kernel/target_disk.c | 9 ++++++---
patches/compat-3.12.patch | 13 +++++++++++++
4 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index cd2e31d..78d0596 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_lt,3,13,0),1)
+ PATCHES := $(PATCHES) compat-3.12.patch
+endif
+
ifeq ($(call kver_lt,3,10,0),1)
PATCHES := $(PATCHES) compat-3.9.patch
endif
@@ -74,15 +78,15 @@ ifeq ($(call kver_lt,3,7,0),1)
PATCHES := $(PATCHES) compat-3.6.patch
endif
-ifeq ($(call kver_le,3,5,0),1)
+ifeq ($(call kver_lt,3,6,0),1)
PATCHES := $(PATCHES) compat-3.5.patch
endif
-ifeq ($(call kver_le,3,4,0),1)
+ifeq ($(call kver_lt,3,5,0),1)
PATCHES := $(PATCHES) compat-3.2-3.4.patch
endif
-ifeq ($(call kver_le,3,2,0),1)
+ifeq ($(call kver_lt,3,3,0),1)
PATCHES := $(PATCHES) compat-2.6.39-3.2.patch
endif
diff --git a/kernel/conn.c b/kernel/conn.c
index f72b366..3740557 100644
--- a/kernel/conn.c
+++ b/kernel/conn.c
@@ -48,7 +48,7 @@ void conn_info_show(struct seq_file *seq, struct iscsi_session *session)
break;
case AF_INET6:
snprintf(buf, sizeof(buf), "[%pI6]",
- &inet6_sk(sk)->daddr);
+ &(sk)->sk_v6_daddr);
break;
default:
break;
diff --git a/kernel/target_disk.c b/kernel/target_disk.c
index 14c0c11..2691ee8 100644
--- a/kernel/target_disk.c
+++ b/kernel/target_disk.c
@@ -9,6 +9,7 @@
#include <linux/ctype.h>
#include <scsi/scsi.h>
+#include <asm/unaligned.h>
#include "iscsi.h"
#include "iscsi_dbg.h"
@@ -357,16 +358,18 @@ static void build_service_action_in_response(struct iscsi_cmnd *cmnd)
struct tio *tio = cmnd->tio;
u32 *data;
u64 *data64;
-
+ u32 alloc_len;
+ const u8* cdb = cmnd_hdr(cmnd)->scb;
assert(!tio);
/* only READ_CAPACITY_16 service action is currently supported */
- if ((cmnd_hdr(cmnd)->scb[1] & 0x1F) != 0x10) {
+ if ((cdb[1] & 0x1F) != 0x10) {
/* Invalid Field In CDB */
iscsi_cmnd_set_sense(cmnd, ILLEGAL_REQUEST, 0x24, 0x0);
return;
}
+ alloc_len = get_unaligned_be32(&cdb[10]);
tio = cmnd->tio = tio_alloc(1);
data = page_address(tio->pvec[0]);
assert(data);
@@ -375,7 +378,7 @@ static void build_service_action_in_response(struct iscsi_cmnd *cmnd)
data64[0] = cpu_to_be64(cmnd->lun->blk_cnt - 1);
data[2] = cpu_to_be32(1UL << cmnd->lun->blk_shift);
- tio_set(tio, 32, 0);
+ tio_set(tio, min_t(u32, alloc_len, 32), 0);
}
static void build_read_response(struct iscsi_cmnd *cmnd)
diff --git a/patches/compat-3.12.patch b/patches/compat-3.12.patch
new file mode 100644
index 0000000..8e4ec98
--- /dev/null
+++ b/patches/compat-3.12.patch
@@ -0,0 +1,13 @@
+Index: iscsitarget-code/kernel/conn.c
+===================================================================
+--- iscsitarget-code.orig/kernel/conn.c
++++ iscsitarget-code/kernel/conn.c
+@@ -48,7 +48,7 @@ void conn_info_show(struct seq_file *seq
+ break;
+ case AF_INET6:
+ snprintf(buf, sizeof(buf), "[%pI6]",
+- &(sk)->sk_v6_daddr);
++ &inet6_sk(sk)->daddr);
+ break;
+ default:
+ break;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-iscsi/iscsitarget.git
More information about the Pkg-iscsi-maintainers
mailing list