From 918c1138588187c5dbc5d25c50455f93e78d4af7 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 23 Aug 2007 15:29:44 +0000 Subject: [PATCH] - Updated to the latest IET (r137) - ToDo note added git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@167 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/etc/initd/initd | 2 +- iscsi-scst/etc/initd/initd.debian | 14 +++++++------- iscsi-scst/etc/initd/initd.redhat | 6 +++--- iscsi-scst/include/iscsi_u.h | 2 +- iscsi-scst/kernel/iscsi.c | 11 +++++++++++ iscsi-scst/usr/isns.c | 3 ++- 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/iscsi-scst/etc/initd/initd b/iscsi-scst/etc/initd/initd index e424b2710..14e124fb6 100644 --- a/iscsi-scst/etc/initd/initd +++ b/iscsi-scst/etc/initd/initd @@ -44,7 +44,7 @@ start_server() modprobe iscsi-scst /usr/local/sbin/iscsi-scstd } - + stop_server() { killall iscsi-scstd diff --git a/iscsi-scst/etc/initd/initd.debian b/iscsi-scst/etc/initd/initd.debian index ae699726e..7149e9d40 100644 --- a/iscsi-scst/etc/initd/initd.debian +++ b/iscsi-scst/etc/initd/initd.debian @@ -55,11 +55,11 @@ iscsi_scstd_start() modprobe iscsi-scst start-stop-daemon --start --exec $DAEMON --quiet RETVAL=$? - if [ $RETVAL == "0" ]; then + if [ $RETVAL -eq 0 ]; then echo "succeeded." else echo "failed." - fi + fi } iscsi_scstd_stop() @@ -67,7 +67,7 @@ iscsi_scstd_stop() echo -n "Stopping iSCSI-SCST target service: " start-stop-daemon --stop --quiet --exec $DAEMON --pidfile $PID_FILE RETVAL=$? - if [ $RETVAL == "0" ]; then + if [ $RETVAL -eq 0 ]; then echo "succeeded." else echo "failed." @@ -79,7 +79,7 @@ iscsi_scstd_stop() rmmod -w iscsi-scst RETVAL=$? modprobe -r crc32c 2>/dev/null - if [ $RETVAL == "0" ]; then + if [ $RETVAL -eq 0 ]; then echo "succeeded." else echo "failed." @@ -106,18 +106,18 @@ case "$1" in else echo "no iSCSI-SCST target found!" exit 1 - fi + fi ;; dump) DUMP=`tempfile -p iscsi-scstd` RETVAL=$? - if [ $RETVAL != "0" ]; then + if [ $RETVAL -ne 0 ]; then echo "Failed to create dump file $DUMP" exit 1 fi iscsi-scst-adm --mode dump --all >$DUMP RETVAL=$? - if [ $RETVAL != "0" ]; then + if [ $RETVAL -ne 0 ]; then echo "Error dumping config from daemon" rm $DUMP exit 1 diff --git a/iscsi-scst/etc/initd/initd.redhat b/iscsi-scst/etc/initd/initd.redhat index b46d40112..6ce007619 100644 --- a/iscsi-scst/etc/initd/initd.redhat +++ b/iscsi-scst/etc/initd/initd.redhat @@ -63,7 +63,7 @@ start() echo return $RETVAL } - + stop() { echo -n "Stopping iSCSI target service: " @@ -72,7 +72,7 @@ stop() rmmod -w iscsi-scst RETVAL=$? modprobe -r crc32c 2>/dev/null - if [ $RETVAL == "0" ]; then + if [ $RETVAL -eq 0 ]; then echo_success else echo_failure @@ -103,7 +103,7 @@ status() exit 1 else echo "iscsi-scstd (pid $PID) is running..." - fi + fi } case "$1" in diff --git a/iscsi-scst/include/iscsi_u.h b/iscsi-scst/include/iscsi_u.h index a71bac9ff..4d7c748c9 100644 --- a/iscsi-scst/include/iscsi_u.h +++ b/iscsi-scst/include/iscsi_u.h @@ -20,7 +20,7 @@ #include #endif -#define ISCSI_VERSION_STRING "0.9.6/0.4.15r133" +#define ISCSI_VERSION_STRING "0.9.6/0.4.15r137" /* The maximum length of 223 bytes in the RFC. */ #define ISCSI_NAME_LEN 256 diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index c4c40edfa..1abbae248 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -1510,6 +1510,17 @@ static void execute_task_management(struct iscsi_cmnd *req) TRACE(TRACE_MGMT, "TM cmd: req %p, itt %x, fn %d, rtt %x", req, cmnd_itt(req), function, req_hdr->rtt); + /* + * ToDo: relevant TM functions shall affect only commands with + * CmdSN lower req_hdr->cmd_sn (see RFC 3720 section 10.5). + * + * I suppose, iscsi_session_push_cmnd() should be updated to keep + * commands with higher CmdSN in the session->pending_list until + * executing TM command finished. Although, if higher CmdSN commands + * might be already sent to SCST for execution, it could get much more + * complicated and should be implemented on SCST level. + */ + switch (function) { case ISCSI_FUNCTION_ABORT_TASK: err = cmnd_abort(conn->session, req_hdr->rtt); diff --git a/iscsi-scst/usr/isns.c b/iscsi-scst/usr/isns.c index 2e47ce54c..99cb4a78c 100644 --- a/iscsi-scst/usr/isns.c +++ b/iscsi-scst/usr/isns.c @@ -258,7 +258,8 @@ static int isns_scn_register(void) scn_flags = ISNS_SCN_FLAG_INITIATOR | ISNS_SCN_FLAG_OBJECT_REMOVE | ISNS_SCN_FLAG_OBJECT_ADDED | ISNS_SCN_FLAG_OBJECT_UPDATED; - scn_flags = htonl(set_scn_flag(scn_flags)); + set_scn_flag(scn_flags); + scn_flags = htonl(scn_flags); length += isns_tlv_set(&tlv, ISNS_ATTR_ISCSI_SCN_BITMAP, sizeof(scn_flags), &scn_flags);