- Disallow to pass command to low level driver when we user is disabling target
authorswgruszka <swgruszka@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Tue, 14 Apr 2009 20:25:20 +0000 (20:25 +0000)
committerswgruszka <swgruszka@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Tue, 14 Apr 2009 20:25:20 +0000 (20:25 +0000)
  mode (protect by disable_sem).
- Fix parentheses in unlikely statement.

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

qla_isp/linux/isp_scst.c

index 44be93a..eef0804 100644 (file)
@@ -1108,12 +1108,12 @@ isp_rdy_to_xfer(struct scst_cmd *scst_cmd)
         }
 
         BUS_DBG2(bp, "TMD[%llx] write nbytes %u\n", tmd->cd_tagval, scst_cmd_get_bufflen(scst_cmd));
-        up_read(&bc->disable_sem);
         (*bp->h.r_action)(QIN_TMD_CONT, xact);
+        up_read(&bc->disable_sem);
         /*
          * Did we have an error starting this particular transaction?
          */
-        if (unlikely(xact->td_lflags & (TDFL_ERROR|TDFL_SYNCERROR)) == (TDFL_ERROR|TDFL_SYNCERROR)) {
+        if (unlikely((xact->td_lflags & (TDFL_ERROR|TDFL_SYNCERROR)) == (TDFL_ERROR|TDFL_SYNCERROR))) {
             if (xact->td_error == -ENOMEM) {
                 return (SCST_TGT_RES_QUEUE_FULL);
             } else {
@@ -1224,7 +1224,7 @@ out:
     /*
      * Did we have an error starting this particular transaction?
      */
-    if (unlikely(xact->td_lflags & (TDFL_ERROR|TDFL_SYNCERROR)) == (TDFL_ERROR|TDFL_SYNCERROR)) {
+    if (unlikely((xact->td_lflags & (TDFL_ERROR|TDFL_SYNCERROR)) == (TDFL_ERROR|TDFL_SYNCERROR))) {
         if (xact->td_error == -ENOMEM) {
             return (SCST_TGT_RES_QUEUE_FULL);
         } else {