- Updated to the latest IET (r137)
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 23 Aug 2007 15:29:44 +0000 (15:29 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 23 Aug 2007 15:29:44 +0000 (15:29 +0000)
 - ToDo note added

git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@167 d57e44dd-8a1f-0410-8b47-8ef2f437770f

iscsi-scst/etc/initd/initd
iscsi-scst/etc/initd/initd.debian
iscsi-scst/etc/initd/initd.redhat
iscsi-scst/include/iscsi_u.h
iscsi-scst/kernel/iscsi.c
iscsi-scst/usr/isns.c

index e424b27..14e124f 100644 (file)
@@ -44,7 +44,7 @@ start_server()
        modprobe iscsi-scst
        /usr/local/sbin/iscsi-scstd
 }
-       
+
 stop_server()
 {
        killall iscsi-scstd
index ae69972..7149e9d 100644 (file)
@@ -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
index b46d401..6ce0076 100644 (file)
@@ -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
index a71bac9..4d7c748 100644 (file)
@@ -20,7 +20,7 @@
 #include <sys/uio.h>
 #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
index c4c40ed..1abbae2 100644 (file)
@@ -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);
index 2e47ce5..99cb4a7 100644 (file)
@@ -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);