Hello community,
here is the log from the commit of package iscsitarget
checked in at Wed May 31 16:54:53 CEST 2006.
--------
--- iscsitarget/iscsitarget.changes 2006-05-22 15:21:41.000000000 +0200
+++ iscsitarget/iscsitarget.changes 2006-05-31 09:10:08.000000000 +0200
@@ -1,0 +2,5 @@
+Wed May 31 09:09:32 CEST 2006 - hare(a)suse.de
+
+- Pull in fixes from upstream to prevent kernel oops [#179557]
+
+-------------------------------------------------------------------
New:
----
iscsitarget-svn-33.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ iscsitarget.spec ++++++
--- /var/tmp/diff_new_pack.iCvSpf/_old 2006-05-31 16:54:03.000000000 +0200
+++ /var/tmp/diff_new_pack.iCvSpf/_new 2006-05-31 16:54:03.000000000 +0200
@@ -18,11 +18,12 @@
Prereq: %fillup_prereq %insserv_prereq /bin/cat /bin/rm
Autoreqprov: on
Version: 0.4.13
-Release: 15
+Release: 16
Requires: kernel
Summary: Open Source iSCSI Target with Professional Features
Source: %{name}-%{version}.tar.gz
Source1: %{name}.init
+Patch1: %{name}-svn-33.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -39,6 +40,7 @@
%prep
%setup
+%patch1 -p1
%build
%{__make} CFLAGS="${RPM_OPT_FLAGS} -I../include" bindir=/usr/sbin progs
@@ -72,6 +74,8 @@
%doc %{_mandir}/man8/*
%changelog -n iscsitarget
+* Wed May 31 2006 - hare(a)suse.de
+- Pull in fixes from upstream to prevent kernel oops [#179557]
* Mon May 22 2006 - hare(a)suse.de
- Set mode for /etc/ietd.conf to 600 [#177081]
* Thu May 18 2006 - kukuk(a)suse.de
++++++ iscsitarget-svn-33.diff ++++++
diff -pur iscsitarget-0.4.13/include/iet_u.h iscsitarget/include/iet_u.h
--- iscsitarget-0.4.13/include/iet_u.h 2006-01-13 15:24:04.000000000 +0100
+++ iscsitarget/include/iet_u.h 2006-02-09 11:07:10.000000000 +0100
@@ -1,7 +1,7 @@
#ifndef _IET_U_H
#define _IET_U_H
-#define IET_VERSION_STRING "0.4.12"
+#define IET_VERSION_STRING "0.4.13"
/* The maximum length of 223 bytes in the RFC. */
#define ISCSI_NAME_LEN 256
diff -pur iscsitarget-0.4.13/kernel/config.c iscsitarget/kernel/config.c
--- iscsitarget-0.4.13/kernel/config.c 2006-01-13 15:24:04.000000000 +0100
+++ iscsitarget/kernel/config.c 2006-05-31 08:55:29.000000000 +0200
@@ -310,4 +310,5 @@ done:
struct file_operations ctr_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = ioctl,
+ .compat_ioctl = ioctl,
};
diff -pur iscsitarget-0.4.13/kernel/file-io.c iscsitarget/kernel/file-io.c
--- iscsitarget-0.4.13/kernel/file-io.c 2006-01-13 15:24:04.000000000 +0100
+++ iscsitarget/kernel/file-io.c 2006-05-31 08:55:29.000000000 +0200
@@ -26,7 +26,7 @@ static int fileio_make_request(struct ie
u32 offset, size;
loff_t ppos, count;
char *buf;
- int i;
+ int i, err = 0;
ssize_t ret;
assert(p);
@@ -58,15 +58,17 @@ static int fileio_make_request(struct ie
set_fs(oldfs);
- if (ret != count)
+ if (ret != count) {
eprintk("I/O error %lld, %ld\n", count, (long) ret);
+ err = -EIO;
+ }
size -= count;
offset = 0;
}
assert(!size);
- return 0;
+ return err;
}
static int fileio_sync(struct iet_volume *lu, struct tio *tio)
diff -pur iscsitarget-0.4.13/kernel/iscsi.c iscsitarget/kernel/iscsi.c
--- iscsitarget-0.4.13/kernel/iscsi.c 2006-01-13 15:24:04.000000000 +0100
+++ iscsitarget/kernel/iscsi.c 2006-05-31 08:55:29.000000000 +0200
@@ -223,10 +223,10 @@ static void iscsi_cmnd_init_write(struct
LIST_HEAD(head);
if (!list_empty(&cmnd->list)) {
- eprintk("%x %x %x %x %lx %lx %u %u %u %u %u %u %u %d %d\n",
+ eprintk("%x %x %x %x %lx %u %u %u %u %u %u %u %d %d\n",
cmnd_itt(cmnd), cmnd_ttt(cmnd), cmnd_opcode(cmnd),
- cmnd_scsicode(cmnd), cmnd->state, cmnd->flags,
- cmnd->r2t_sn, cmnd->r2t_length, cmnd->is_unsolicited_data,
+ cmnd_scsicode(cmnd), cmnd->flags, cmnd->r2t_sn,
+ cmnd->r2t_length, cmnd->is_unsolicited_data,
cmnd->target_task_tag, cmnd->outstanding_r2t,
cmnd->hdigest, cmnd->ddigest,
list_empty(&cmnd->pdu_list), list_empty(&cmnd->hash_list));
@@ -315,25 +315,6 @@ static struct iscsi_cmnd *create_scsi_rs
return rsp;
}
-void send_scsi_rsp(struct iscsi_cmnd *req, int (*func)(struct iscsi_cmnd *))
-{
- struct iscsi_cmnd *rsp;
- struct iscsi_scsi_rsp_hdr *rsp_hdr;
- u32 size;
-
- rsp = create_scsi_rsp(req);
- rsp_hdr = (struct iscsi_scsi_rsp_hdr *) &rsp->pdu.bhs;
- if ((size = cmnd_read_size(req)) != 0) {
- rsp_hdr->flags |= ISCSI_FLG_RESIDUAL_UNDERFLOW;
- rsp_hdr->residual_count = cpu_to_be32(size);
- }
-
- if (func(req) < 0)
- eprintk("%x\n", cmnd_opcode(req));
-
- iscsi_cmnd_init_write(rsp);
-}
-
static struct iscsi_cmnd *create_sense_rsp(struct iscsi_cmnd *req,
u8 sense_key, u8 asc, u8 ascq)
{
@@ -369,15 +350,47 @@ static struct iscsi_cmnd *create_sense_r
return rsp;
}
-void send_data_rsp(struct iscsi_cmnd *req, int (*func)(struct iscsi_cmnd *))
+void send_scsi_rsp(struct iscsi_cmnd *req, int (*func)(struct iscsi_cmnd *))
{
struct iscsi_cmnd *rsp;
+ struct iscsi_scsi_rsp_hdr *rsp_hdr;
+ u32 size;
- if (func(req) < 0) {
+ switch (func(req)) {
+ case 0:
+ rsp = create_scsi_rsp(req);
+ rsp_hdr = (struct iscsi_scsi_rsp_hdr *) &rsp->pdu.bhs;
+ if ((size = cmnd_read_size(req)) != 0) {
+ rsp_hdr->flags |= ISCSI_FLG_RESIDUAL_UNDERFLOW;
+ rsp_hdr->residual_count = cpu_to_be32(size);
+ }
+ break;
+ case -EIO:
+ /* Medium Error/Write Fault */
+ rsp = create_sense_rsp(req, MEDIUM_ERROR, 0x03, 0x0);
+ break;
+ default:
rsp = create_sense_rsp(req, ILLEGAL_REQUEST, 0x24, 0x0);
- iscsi_cmnd_init_write(rsp);
- } else
+ }
+ iscsi_cmnd_init_write(rsp);
+}
+
+void send_data_rsp(struct iscsi_cmnd *req, int (*func)(struct iscsi_cmnd *))
+{
+ struct iscsi_cmnd *rsp;
+
+ switch (func(req)) {
+ case 0:
do_send_data_rsp(req);
+ return;
+ case -EIO:
+ /* Medium Error/Unrecovered Read Error */
+ rsp = create_sense_rsp(req, MEDIUM_ERROR, 0x11, 0x0);
+ break;
+ default:
+ rsp = create_sense_rsp(req, ILLEGAL_REQUEST, 0x24, 0x0);
+ }
+ iscsi_cmnd_init_write(rsp);
}
/**
@@ -401,10 +414,11 @@ void iscsi_cmnd_remove(struct iscsi_cmnd
if (!list_empty(&cmnd->list)) {
struct iscsi_scsi_cmd_hdr *req = cmnd_hdr(cmnd);
- eprintk("cmnd %p still on some list?, %x, %x, %x, %x, %x, %x, %x %lx %lx\n",
+ eprintk("cmnd %p still on some list?, %x, %x, %x, %x, %x, %x, %x %lx\n",
cmnd, req->opcode, req->scb[0], req->flags, req->itt,
be32_to_cpu(req->data_length),
- req->cmd_sn, be32_to_cpu(cmnd->pdu.datasize), cmnd->state, conn->state);
+ req->cmd_sn, be32_to_cpu(cmnd->pdu.datasize),
+ conn->state);
if (cmnd->req) {
struct iscsi_scsi_cmd_hdr *req = cmnd_hdr(cmnd->req);
@@ -941,6 +955,7 @@ static void scsi_cmnd_start(struct iscsi
eprintk("%x %x\n", cmnd_itt(req), req_hdr->scb[0]);
create_sense_rsp(req, ABORTED_COMMAND, 0xc, 0xc);
cmnd_skip_data(req);
+ break;
}
set_offset_and_length(req->lun, req_hdr->scb, &offset, &length);
@@ -1548,7 +1563,7 @@ static int check_segment_length(struct i
struct iscsi_sess_param *param = &conn->session->param;
if (cmnd->pdu.datasize > param->max_recv_data_length) {
- eprintk("too lond data %x %u %u\n", cmnd_itt(cmnd),
+ eprintk("data too long %x %u %u\n", cmnd_itt(cmnd),
cmnd->pdu.datasize, param->max_recv_data_length);
if (get_pgcnt(cmnd->pdu.datasize, 0) > ISCSI_CONN_IOV_MAX) {
diff -pur iscsitarget-0.4.13/kernel/iscsi.h iscsitarget/kernel/iscsi.h
--- iscsitarget-0.4.13/kernel/iscsi.h 2006-01-13 15:24:04.000000000 +0100
+++ iscsitarget/kernel/iscsi.h 2006-02-09 11:07:09.000000000 +0100
@@ -231,7 +231,6 @@ typedef void (iet_show_info_t)(struct se
struct iscsi_cmnd {
struct list_head list;
struct list_head conn_list;
- unsigned long state;
unsigned long flags;
struct iscsi_conn *conn;
struct iet_volume *lun;
diff -pur iscsitarget-0.4.13/kernel/target_disk.c iscsitarget/kernel/target_disk.c
--- iscsitarget-0.4.13/kernel/target_disk.c 2006-01-13 15:24:04.000000000 +0100
+++ iscsitarget/kernel/target_disk.c 2006-05-31 08:55:29.000000000 +0200
@@ -23,7 +23,7 @@ static int insert_disconnect_pg(u8 *ptr)
static int insert_caching_pg(u8 *ptr)
{
- unsigned char caching_pg[] = {0x08, 0x12, 0x14, 0x00, 0xff, 0xff, 0x00, 0x00,
+ unsigned char caching_pg[] = {0x08, 0x12, 0x10, 0x00, 0xff, 0xff, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x80, 0x14, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00};
@@ -329,13 +329,13 @@ static int build_read_response(struct is
assert(tio);
assert(cmnd->lun);
- tio_read(cmnd->lun, tio);
- return 0;
+ return tio_read(cmnd->lun, tio);
}
static int build_write_response(struct iscsi_cmnd *cmnd)
{
+ int err;
struct tio *tio = cmnd->tio;
assert(cmnd);
@@ -343,10 +343,11 @@ static int build_write_response(struct i
assert(cmnd->lun);
list_del_init(&cmnd->list);
- tio_write(cmnd->lun, tio);
- tio_sync(cmnd->lun, tio);
+ err = tio_write(cmnd->lun, tio);
+ if (!err)
+ err = tio_sync(cmnd->lun, tio);
- return 0;
+ return err;
}
static int build_generic_response(struct iscsi_cmnd *cmnd)
diff -pur iscsitarget-0.4.13/Makefile iscsitarget/Makefile
--- iscsitarget-0.4.13/Makefile 2006-01-13 15:24:07.000000000 +0100
+++ iscsitarget/Makefile 2006-02-13 14:25:50.000000000 +0100
@@ -7,18 +7,18 @@
#
# Note 2! The CFLAGS definitions are now in the main makefile.
-#export KERNELSRC := /usr/src/linux
+#export KSRC := /usr/src/linux
SUBDIRS := $(shell pwd)
-ifeq ($(KERNELSRC),)
- KERNELSRC ?= /lib/modules/$(shell uname -r)/build
+ifeq ($(KSRC),)
+ KSRC ?= /lib/modules/$(shell uname -r)/build
endif
all: progs mods
mods:
- $(MAKE) -C $(KERNELSRC) SUBDIRS=$(shell pwd)/kernel modules
+ $(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd)/kernel modules
progs:
$(MAKE) -C usr
@@ -37,11 +37,11 @@ install: kernel/iscsi_trgt.ko usr/ietd u
else \
install -vD -m 755 etc/initd/initd $(DISTDIR)/etc/init.d/iscsi-target; \
fi
- @eval `sed -n 's/#define UTS_RELEASE /KERNELRELEASE=/p' $(KERNELSRC)/include/linux/version.h`; \
+ @eval `sed -n 's/#define UTS_RELEASE /KERNELRELEASE=/p' $(KSRC)/include/linux/version.h`; \
install -vD kernel/iscsi_trgt.ko \
$(DISTDIR)$(INSTALL_MOD_PATH)/lib/modules/$$KERNELRELEASE/kernel/iscsi/iscsi_trgt.ko
-depmod -aq
clean:
$(MAKE) -C usr clean
- $(MAKE) -C $(KERNELSRC) SUBDIRS=$(shell pwd)/kernel clean
+ $(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd)/kernel clean
diff -pur iscsitarget-0.4.13/README iscsitarget/README
--- iscsitarget-0.4.13/README 2006-01-13 15:24:07.000000000 +0100
+++ iscsitarget/README 2006-02-13 14:25:50.000000000 +0100
@@ -21,9 +21,9 @@ The iSCSI target consists of kernel modu
compilation of the kernel modules require the path to above kernel
sources:
- make KERNELSRC=<kernel-src>
+ make KSRC=<kernel-src>
-The path can also be set by editing the main Makefile. If KERNELSRC is
+The path can also be set by editing the main Makefile. If KSRC is
omitted, make program will try to locate the kernel sources for
current running kernel. Be sure to check whether it finds the right
kernel sources.
@@ -31,7 +31,7 @@ kernel sources.
This will build the modules, the daemon, and the control tool. To
install both, use:
- make KERNELSRC=<kernel-src> install
+ make KSRC=<kernel-src> install
The kernel modules will be install in the module directory of the
kernel. The daemon and the control tool will be installed as ietd and
diff -pur iscsitarget-0.4.13/usr/ietadm.c iscsitarget/usr/ietadm.c
--- iscsitarget-0.4.13/usr/ietadm.c 2006-01-13 15:24:07.000000000 +0100
+++ iscsitarget/usr/ietadm.c 2006-03-23 13:31:55.000000000 +0100
@@ -62,7 +62,8 @@ static void usage(int status)
iSCSI Enterprise Target Administration Utility.\n\
\n\
--op new --tid=[id] --params Name=[name]\n\
- add a new target with [id]. [id] must not be zero.\n\
+ add a new target with [id]. If [id] is zero the next\n\
+ available target id will be chosen.\n\
--op delete --tid=[id]\n\
delete specific target with [id]. The target must\n\
have no active sessions.\n\
@@ -396,6 +397,8 @@ static int user_handle(int op, u32 set,
req.rcmnd = C_ACCT_DEL;
break;
case OP_UPDATE:
+ req.rcmnd = C_ACCT_UPDATE;
+ break;
case OP_SHOW:
fprintf(stderr, "Unsupported.\n");
goto out;
@@ -431,12 +434,18 @@ static int user_handle(int op, u32 set,
}
}
- if ((op == OP_NEW && ((user && !pass) || (!user && pass) || (!user && !pass))) ||
- (op == OP_DELETE && ((!user && pass) || (!user && !pass)))) {
+ if ((!user && pass) || (!user && !pass)) {
fprintf(stderr,
"You need to specify a user and its password %s %s\n", pass, user);
goto out;
}
+ if ((op == OP_NEW && (user && !pass)) ||
+ (op == OP_UPDATE && (user && !pass))) {
+ fprintf(stderr,
+ "You need to specify a non-empty password for %s\n",
+ user);
+ goto out;
+ }
strncpy(req.u.acnt.user, user, sizeof(req.u.acnt.user) - 1);
if (pass)
diff -pur iscsitarget-0.4.13/usr/Makefile iscsitarget/usr/Makefile
--- iscsitarget-0.4.13/usr/Makefile 2006-01-13 15:24:07.000000000 +0100
+++ iscsitarget/usr/Makefile 2006-03-22 16:32:55.000000000 +0100
@@ -1,4 +1,4 @@
-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include
+CFLAGS += -fno-inline -Wall -Wstrict-prototypes -g -I../include
PROGRAMS = ietd ietadm
LIBS = -lcrypto
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...