aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2009-03-05 15:45:58 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-03-13 16:27:09 -0400
commit1b2c7af877f427a2b25583c9033616c9ebd30aed (patch)
tree9093ff19581e0366567ec359b3f41bc70f239f99 /drivers/scsi
parent48a237a26db0a31404c83a88e984b37a30ddcf5a (diff)
[SCSI] libiscsi: replace scsi_debug logging with session/conn logging
This makes the logging a compile time option and replaces the scsi_debug macro with session and connection ones that print out a driver model id prefix. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libiscsi.c164
1 files changed, 103 insertions, 61 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index c33e28fd49bc..701457cca08a 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -38,6 +38,28 @@
38#include <scsi/scsi_transport_iscsi.h> 38#include <scsi/scsi_transport_iscsi.h>
39#include <scsi/libiscsi.h> 39#include <scsi/libiscsi.h>
40 40
41static int iscsi_dbg_lib;
42module_param_named(debug_libiscsi, iscsi_dbg_lib, int, S_IRUGO | S_IWUSR);
43MODULE_PARM_DESC(debug_libiscsi, "Turn on debugging for libiscsi module. "
44 "Set to 1 to turn on, and zero to turn off. Default "
45 "is off.");
46
47#define ISCSI_DBG_CONN(_conn, dbg_fmt, arg...) \
48 do { \
49 if (iscsi_dbg_lib) \
50 iscsi_conn_printk(KERN_INFO, _conn, \
51 "%s " dbg_fmt, \
52 __func__, ##arg); \
53 } while (0);
54
55#define ISCSI_DBG_SESSION(_session, dbg_fmt, arg...) \
56 do { \
57 if (iscsi_dbg_lib) \
58 iscsi_session_printk(KERN_INFO, _session, \
59 "%s " dbg_fmt, \
60 __func__, ##arg); \
61 } while (0);
62
41/* Serial Number Arithmetic, 32 bits, less than, RFC1982 */ 63/* Serial Number Arithmetic, 32 bits, less than, RFC1982 */
42#define SNA32_CHECK 2147483648UL 64#define SNA32_CHECK 2147483648UL
43 65
@@ -176,10 +198,11 @@ static int iscsi_prep_ecdb_ahs(struct iscsi_task *task)
176 ecdb_ahdr->reserved = 0; 198 ecdb_ahdr->reserved = 0;
177 memcpy(ecdb_ahdr->ecdb, cmd->cmnd + ISCSI_CDB_SIZE, rlen); 199 memcpy(ecdb_ahdr->ecdb, cmd->cmnd + ISCSI_CDB_SIZE, rlen);
178 200
179 debug_scsi("iscsi_prep_ecdb_ahs: varlen_cdb_len %d " 201 ISCSI_DBG_SESSION(task->conn->session,
180 "rlen %d pad_len %d ahs_length %d iscsi_headers_size %u\n", 202 "iscsi_prep_ecdb_ahs: varlen_cdb_len %d "
181 cmd->cmd_len, rlen, pad_len, ahslength, task->hdr_len); 203 "rlen %d pad_len %d ahs_length %d iscsi_headers_size "
182 204 "%u\n", cmd->cmd_len, rlen, pad_len, ahslength,
205 task->hdr_len);
183 return 0; 206 return 0;
184} 207}
185 208
@@ -201,10 +224,11 @@ static int iscsi_prep_bidi_ahs(struct iscsi_task *task)
201 rlen_ahdr->reserved = 0; 224 rlen_ahdr->reserved = 0;
202 rlen_ahdr->read_length = cpu_to_be32(scsi_in(sc)->length); 225 rlen_ahdr->read_length = cpu_to_be32(scsi_in(sc)->length);
203 226
204 debug_scsi("bidi-in rlen_ahdr->read_length(%d) " 227 ISCSI_DBG_SESSION(task->conn->session,
205 "rlen_ahdr->ahslength(%d)\n", 228 "bidi-in rlen_ahdr->read_length(%d) "
206 be32_to_cpu(rlen_ahdr->read_length), 229 "rlen_ahdr->ahslength(%d)\n",
207 be16_to_cpu(rlen_ahdr->ahslength)); 230 be32_to_cpu(rlen_ahdr->read_length),
231 be16_to_cpu(rlen_ahdr->ahslength));
208 return 0; 232 return 0;
209} 233}
210 234
@@ -335,13 +359,15 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
335 list_move_tail(&task->running, &conn->run_list); 359 list_move_tail(&task->running, &conn->run_list);
336 360
337 conn->scsicmd_pdus_cnt++; 361 conn->scsicmd_pdus_cnt++;
338 debug_scsi("iscsi prep [%s cid %d sc %p cdb 0x%x itt 0x%x len %d " 362 ISCSI_DBG_SESSION(session, "iscsi prep [%s cid %d sc %p cdb 0x%x "
339 "bidi_len %d cmdsn %d win %d]\n", scsi_bidi_cmnd(sc) ? 363 "itt 0x%x len %d bidi_len %d cmdsn %d win %d]\n",
340 "bidirectional" : sc->sc_data_direction == DMA_TO_DEVICE ? 364 scsi_bidi_cmnd(sc) ? "bidirectional" :
341 "write" : "read", conn->id, sc, sc->cmnd[0], task->itt, 365 sc->sc_data_direction == DMA_TO_DEVICE ?
342 scsi_bufflen(sc), 366 "write" : "read", conn->id, sc, sc->cmnd[0],
343 scsi_bidi_cmnd(sc) ? scsi_in(sc)->length : 0, 367 task->itt, scsi_bufflen(sc),
344 session->cmdsn, session->max_cmdsn - session->exp_cmdsn + 1); 368 scsi_bidi_cmnd(sc) ? scsi_in(sc)->length : 0,
369 session->cmdsn,
370 session->max_cmdsn - session->exp_cmdsn + 1);
345 return 0; 371 return 0;
346} 372}
347 373
@@ -483,9 +509,9 @@ static int iscsi_prep_mgmt_task(struct iscsi_conn *conn,
483 509
484 task->state = ISCSI_TASK_RUNNING; 510 task->state = ISCSI_TASK_RUNNING;
485 list_move_tail(&task->running, &conn->mgmt_run_list); 511 list_move_tail(&task->running, &conn->mgmt_run_list);
486 debug_scsi("mgmtpdu [op 0x%x hdr->itt 0x%x datalen %d]\n", 512 ISCSI_DBG_SESSION(session, "mgmtpdu [op 0x%x hdr->itt 0x%x "
487 hdr->opcode & ISCSI_OPCODE_MASK, hdr->itt, 513 "datalen %d]\n", hdr->opcode & ISCSI_OPCODE_MASK,
488 task->data_count); 514 hdr->itt, task->data_count);
489 return 0; 515 return 0;
490} 516}
491 517
@@ -637,8 +663,9 @@ invalid_datalen:
637 663
638 memcpy(sc->sense_buffer, data + 2, 664 memcpy(sc->sense_buffer, data + 2,
639 min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE)); 665 min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE));
640 debug_scsi("copied %d bytes of sense\n", 666 ISCSI_DBG_SESSION(session, "copied %d bytes of sense\n",
641 min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE)); 667 min_t(uint16_t, senselen,
668 SCSI_SENSE_BUFFERSIZE));
642 } 669 }
643 670
644 if (rhdr->flags & (ISCSI_FLAG_CMD_BIDI_UNDERFLOW | 671 if (rhdr->flags & (ISCSI_FLAG_CMD_BIDI_UNDERFLOW |
@@ -666,8 +693,8 @@ invalid_datalen:
666 sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status; 693 sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status;
667 } 694 }
668out: 695out:
669 debug_scsi("done [sc %lx res %d itt 0x%x]\n", 696 ISCSI_DBG_SESSION(session, "done [sc %p res %d itt 0x%x]\n",
670 (long)sc, sc->result, task->itt); 697 sc, sc->result, task->itt);
671 conn->scsirsp_pdus_cnt++; 698 conn->scsirsp_pdus_cnt++;
672 699
673 __iscsi_put_task(task); 700 __iscsi_put_task(task);
@@ -835,8 +862,8 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
835 else 862 else
836 itt = ~0U; 863 itt = ~0U;
837 864
838 debug_scsi("[op 0x%x cid %d itt 0x%x len %d]\n", 865 ISCSI_DBG_SESSION(session, "[op 0x%x cid %d itt 0x%x len %d]\n",
839 opcode, conn->id, itt, datalen); 866 opcode, conn->id, itt, datalen);
840 867
841 if (itt == ~0U) { 868 if (itt == ~0U) {
842 iscsi_update_cmdsn(session, (struct iscsi_nopin*)hdr); 869 iscsi_update_cmdsn(session, (struct iscsi_nopin*)hdr);
@@ -1095,10 +1122,10 @@ static int iscsi_check_cmdsn_window_closed(struct iscsi_conn *conn)
1095 * Check for iSCSI window and take care of CmdSN wrap-around 1122 * Check for iSCSI window and take care of CmdSN wrap-around
1096 */ 1123 */
1097 if (!iscsi_sna_lte(session->queued_cmdsn, session->max_cmdsn)) { 1124 if (!iscsi_sna_lte(session->queued_cmdsn, session->max_cmdsn)) {
1098 debug_scsi("iSCSI CmdSN closed. ExpCmdSn %u MaxCmdSN %u " 1125 ISCSI_DBG_SESSION(session, "iSCSI CmdSN closed. ExpCmdSn "
1099 "CmdSN %u/%u\n", session->exp_cmdsn, 1126 "%u MaxCmdSN %u CmdSN %u/%u\n",
1100 session->max_cmdsn, session->cmdsn, 1127 session->exp_cmdsn, session->max_cmdsn,
1101 session->queued_cmdsn); 1128 session->cmdsn, session->queued_cmdsn);
1102 return -ENOSPC; 1129 return -ENOSPC;
1103 } 1130 }
1104 return 0; 1131 return 0;
@@ -1152,7 +1179,7 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
1152 1179
1153 spin_lock_bh(&conn->session->lock); 1180 spin_lock_bh(&conn->session->lock);
1154 if (unlikely(conn->suspend_tx)) { 1181 if (unlikely(conn->suspend_tx)) {
1155 debug_scsi("conn %d Tx suspended!\n", conn->id); 1182 ISCSI_DBG_SESSION(conn->session, "Tx suspended!\n");
1156 spin_unlock_bh(&conn->session->lock); 1183 spin_unlock_bh(&conn->session->lock);
1157 return -ENODATA; 1184 return -ENODATA;
1158 } 1185 }
@@ -1398,7 +1425,8 @@ prepd_reject:
1398 iscsi_complete_command(task); 1425 iscsi_complete_command(task);
1399reject: 1426reject:
1400 spin_unlock(&session->lock); 1427 spin_unlock(&session->lock);
1401 debug_scsi("cmd 0x%x rejected (%d)\n", sc->cmnd[0], reason); 1428 ISCSI_DBG_SESSION(session, "cmd 0x%x rejected (%d)\n",
1429 sc->cmnd[0], reason);
1402 spin_lock(host->host_lock); 1430 spin_lock(host->host_lock);
1403 return SCSI_MLQUEUE_TARGET_BUSY; 1431 return SCSI_MLQUEUE_TARGET_BUSY;
1404 1432
@@ -1407,7 +1435,8 @@ prepd_fault:
1407 iscsi_complete_command(task); 1435 iscsi_complete_command(task);
1408fault: 1436fault:
1409 spin_unlock(&session->lock); 1437 spin_unlock(&session->lock);
1410 debug_scsi("iscsi: cmd 0x%x is not queued (%d)\n", sc->cmnd[0], reason); 1438 ISCSI_DBG_SESSION(session, "iscsi: cmd 0x%x is not queued (%d)\n",
1439 sc->cmnd[0], reason);
1411 if (!scsi_bidi_cmnd(sc)) 1440 if (!scsi_bidi_cmnd(sc))
1412 scsi_set_resid(sc, scsi_bufflen(sc)); 1441 scsi_set_resid(sc, scsi_bufflen(sc));
1413 else { 1442 else {
@@ -1457,8 +1486,10 @@ int iscsi_eh_target_reset(struct scsi_cmnd *sc)
1457 spin_lock_bh(&session->lock); 1486 spin_lock_bh(&session->lock);
1458 if (session->state == ISCSI_STATE_TERMINATE) { 1487 if (session->state == ISCSI_STATE_TERMINATE) {
1459failed: 1488failed:
1460 debug_scsi("failing target reset: session terminated " 1489 iscsi_session_printk(KERN_INFO, session,
1461 "[CID %d age %d]\n", conn->id, session->age); 1490 "failing target reset: Could not log "
1491 "back into target [age %d]\n",
1492 session->age);
1462 spin_unlock_bh(&session->lock); 1493 spin_unlock_bh(&session->lock);
1463 mutex_unlock(&session->eh_mutex); 1494 mutex_unlock(&session->eh_mutex);
1464 return FAILED; 1495 return FAILED;
@@ -1472,7 +1503,7 @@ failed:
1472 */ 1503 */
1473 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 1504 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
1474 1505
1475 debug_scsi("iscsi_eh_target_reset wait for relogin\n"); 1506 ISCSI_DBG_SESSION(session, "wait for relogin\n");
1476 wait_event_interruptible(conn->ehwait, 1507 wait_event_interruptible(conn->ehwait,
1477 session->state == ISCSI_STATE_TERMINATE || 1508 session->state == ISCSI_STATE_TERMINATE ||
1478 session->state == ISCSI_STATE_LOGGED_IN || 1509 session->state == ISCSI_STATE_LOGGED_IN ||
@@ -1501,7 +1532,7 @@ static void iscsi_tmf_timedout(unsigned long data)
1501 spin_lock(&session->lock); 1532 spin_lock(&session->lock);
1502 if (conn->tmf_state == TMF_QUEUED) { 1533 if (conn->tmf_state == TMF_QUEUED) {
1503 conn->tmf_state = TMF_TIMEDOUT; 1534 conn->tmf_state = TMF_TIMEDOUT;
1504 debug_scsi("tmf timedout\n"); 1535 ISCSI_DBG_SESSION(session, "tmf timedout\n");
1505 /* unblock eh_abort() */ 1536 /* unblock eh_abort() */
1506 wake_up(&conn->ehwait); 1537 wake_up(&conn->ehwait);
1507 } 1538 }
@@ -1521,7 +1552,7 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
1521 spin_unlock_bh(&session->lock); 1552 spin_unlock_bh(&session->lock);
1522 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 1553 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
1523 spin_lock_bh(&session->lock); 1554 spin_lock_bh(&session->lock);
1524 debug_scsi("tmf exec failure\n"); 1555 ISCSI_DBG_SESSION(session, "tmf exec failure\n");
1525 return -EPERM; 1556 return -EPERM;
1526 } 1557 }
1527 conn->tmfcmd_pdus_cnt++; 1558 conn->tmfcmd_pdus_cnt++;
@@ -1529,7 +1560,7 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
1529 conn->tmf_timer.function = iscsi_tmf_timedout; 1560 conn->tmf_timer.function = iscsi_tmf_timedout;
1530 conn->tmf_timer.data = (unsigned long)conn; 1561 conn->tmf_timer.data = (unsigned long)conn;
1531 add_timer(&conn->tmf_timer); 1562 add_timer(&conn->tmf_timer);
1532 debug_scsi("tmf set timeout\n"); 1563 ISCSI_DBG_SESSION(session, "tmf set timeout\n");
1533 1564
1534 spin_unlock_bh(&session->lock); 1565 spin_unlock_bh(&session->lock);
1535 mutex_unlock(&session->eh_mutex); 1566 mutex_unlock(&session->eh_mutex);
@@ -1573,16 +1604,18 @@ static void fail_all_commands(struct iscsi_conn *conn, unsigned lun,
1573 /* flush pending */ 1604 /* flush pending */
1574 list_for_each_entry_safe(task, tmp, &conn->xmitqueue, running) { 1605 list_for_each_entry_safe(task, tmp, &conn->xmitqueue, running) {
1575 if (lun == task->sc->device->lun || lun == -1) { 1606 if (lun == task->sc->device->lun || lun == -1) {
1576 debug_scsi("failing pending sc %p itt 0x%x\n", 1607 ISCSI_DBG_SESSION(conn->session,
1577 task->sc, task->itt); 1608 "failing pending sc %p itt 0x%x\n",
1609 task->sc, task->itt);
1578 fail_command(conn, task, error << 16); 1610 fail_command(conn, task, error << 16);
1579 } 1611 }
1580 } 1612 }
1581 1613
1582 list_for_each_entry_safe(task, tmp, &conn->requeue, running) { 1614 list_for_each_entry_safe(task, tmp, &conn->requeue, running) {
1583 if (lun == task->sc->device->lun || lun == -1) { 1615 if (lun == task->sc->device->lun || lun == -1) {
1584 debug_scsi("failing requeued sc %p itt 0x%x\n", 1616 ISCSI_DBG_SESSION(conn->session,
1585 task->sc, task->itt); 1617 "failing requeued sc %p itt 0x%x\n",
1618 task->sc, task->itt);
1586 fail_command(conn, task, error << 16); 1619 fail_command(conn, task, error << 16);
1587 } 1620 }
1588 } 1621 }
@@ -1590,8 +1623,9 @@ static void fail_all_commands(struct iscsi_conn *conn, unsigned lun,
1590 /* fail all other running */ 1623 /* fail all other running */
1591 list_for_each_entry_safe(task, tmp, &conn->run_list, running) { 1624 list_for_each_entry_safe(task, tmp, &conn->run_list, running) {
1592 if (lun == task->sc->device->lun || lun == -1) { 1625 if (lun == task->sc->device->lun || lun == -1) {
1593 debug_scsi("failing in progress sc %p itt 0x%x\n", 1626 ISCSI_DBG_SESSION(conn->session,
1594 task->sc, task->itt); 1627 "failing in progress sc %p itt 0x%x\n",
1628 task->sc, task->itt);
1595 fail_command(conn, task, error << 16); 1629 fail_command(conn, task, error << 16);
1596 } 1630 }
1597 } 1631 }
@@ -1622,7 +1656,7 @@ static enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *scmd)
1622 cls_session = starget_to_session(scsi_target(scmd->device)); 1656 cls_session = starget_to_session(scsi_target(scmd->device));
1623 session = cls_session->dd_data; 1657 session = cls_session->dd_data;
1624 1658
1625 debug_scsi("scsi cmd %p timedout\n", scmd); 1659 ISCSI_DBG_SESSION(session, "scsi cmd %p timedout\n", scmd);
1626 1660
1627 spin_lock(&session->lock); 1661 spin_lock(&session->lock);
1628 if (session->state != ISCSI_STATE_LOGGED_IN) { 1662 if (session->state != ISCSI_STATE_LOGGED_IN) {
@@ -1662,8 +1696,8 @@ static enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *scmd)
1662 rc = BLK_EH_RESET_TIMER; 1696 rc = BLK_EH_RESET_TIMER;
1663done: 1697done:
1664 spin_unlock(&session->lock); 1698 spin_unlock(&session->lock);
1665 debug_scsi("return %s\n", rc == BLK_EH_RESET_TIMER ? 1699 ISCSI_DBG_SESSION(session, "return %s\n", rc == BLK_EH_RESET_TIMER ?
1666 "timer reset" : "nh"); 1700 "timer reset" : "nh");
1667 return rc; 1701 return rc;
1668} 1702}
1669 1703
@@ -1697,13 +1731,13 @@ static void iscsi_check_transport_timeouts(unsigned long data)
1697 1731
1698 if (time_before_eq(last_recv + recv_timeout, jiffies)) { 1732 if (time_before_eq(last_recv + recv_timeout, jiffies)) {
1699 /* send a ping to try to provoke some traffic */ 1733 /* send a ping to try to provoke some traffic */
1700 debug_scsi("Sending nopout as ping on conn %p\n", conn); 1734 ISCSI_DBG_CONN(conn, "Sending nopout as ping\n");
1701 iscsi_send_nopout(conn, NULL); 1735 iscsi_send_nopout(conn, NULL);
1702 next_timeout = conn->last_ping + (conn->ping_timeout * HZ); 1736 next_timeout = conn->last_ping + (conn->ping_timeout * HZ);
1703 } else 1737 } else
1704 next_timeout = last_recv + recv_timeout; 1738 next_timeout = last_recv + recv_timeout;
1705 1739
1706 debug_scsi("Setting next tmo %lu\n", next_timeout); 1740 ISCSI_DBG_CONN(conn, "Setting next tmo %lu\n", next_timeout);
1707 mod_timer(&conn->transport_timer, next_timeout); 1741 mod_timer(&conn->transport_timer, next_timeout);
1708done: 1742done:
1709 spin_unlock(&session->lock); 1743 spin_unlock(&session->lock);
@@ -1740,7 +1774,8 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
1740 * got the command. 1774 * got the command.
1741 */ 1775 */
1742 if (!sc->SCp.ptr) { 1776 if (!sc->SCp.ptr) {
1743 debug_scsi("sc never reached iscsi layer or it completed.\n"); 1777 ISCSI_DBG_SESSION(session, "sc never reached iscsi layer or "
1778 "it completed.\n");
1744 spin_unlock_bh(&session->lock); 1779 spin_unlock_bh(&session->lock);
1745 mutex_unlock(&session->eh_mutex); 1780 mutex_unlock(&session->eh_mutex);
1746 return SUCCESS; 1781 return SUCCESS;
@@ -1762,11 +1797,13 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
1762 age = session->age; 1797 age = session->age;
1763 1798
1764 task = (struct iscsi_task *)sc->SCp.ptr; 1799 task = (struct iscsi_task *)sc->SCp.ptr;
1765 debug_scsi("aborting [sc %p itt 0x%x]\n", sc, task->itt); 1800 ISCSI_DBG_SESSION(session, "aborting [sc %p itt 0x%x]\n",
1801 sc, task->itt);
1766 1802
1767 /* task completed before time out */ 1803 /* task completed before time out */
1768 if (!task->sc) { 1804 if (!task->sc) {
1769 debug_scsi("sc completed while abort in progress\n"); 1805 ISCSI_DBG_SESSION(session, "sc completed while abort in "
1806 "progress\n");
1770 goto success; 1807 goto success;
1771 } 1808 }
1772 1809
@@ -1815,7 +1852,8 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
1815 if (!sc->SCp.ptr) { 1852 if (!sc->SCp.ptr) {
1816 conn->tmf_state = TMF_INITIAL; 1853 conn->tmf_state = TMF_INITIAL;
1817 /* task completed before tmf abort response */ 1854 /* task completed before tmf abort response */
1818 debug_scsi("sc completed while abort in progress\n"); 1855 ISCSI_DBG_SESSION(session, "sc completed while abort "
1856 "in progress\n");
1819 goto success; 1857 goto success;
1820 } 1858 }
1821 /* fall through */ 1859 /* fall through */
@@ -1827,15 +1865,16 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
1827success: 1865success:
1828 spin_unlock_bh(&session->lock); 1866 spin_unlock_bh(&session->lock);
1829success_unlocked: 1867success_unlocked:
1830 debug_scsi("abort success [sc %lx itt 0x%x]\n", (long)sc, task->itt); 1868 ISCSI_DBG_SESSION(session, "abort success [sc %p itt 0x%x]\n",
1869 sc, task->itt);
1831 mutex_unlock(&session->eh_mutex); 1870 mutex_unlock(&session->eh_mutex);
1832 return SUCCESS; 1871 return SUCCESS;
1833 1872
1834failed: 1873failed:
1835 spin_unlock_bh(&session->lock); 1874 spin_unlock_bh(&session->lock);
1836failed_unlocked: 1875failed_unlocked:
1837 debug_scsi("abort failed [sc %p itt 0x%x]\n", sc, 1876 ISCSI_DBG_SESSION(session, "abort failed [sc %p itt 0x%x]\n", sc,
1838 task ? task->itt : 0); 1877 task ? task->itt : 0);
1839 mutex_unlock(&session->eh_mutex); 1878 mutex_unlock(&session->eh_mutex);
1840 return FAILED; 1879 return FAILED;
1841} 1880}
@@ -1862,7 +1901,8 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
1862 cls_session = starget_to_session(scsi_target(sc->device)); 1901 cls_session = starget_to_session(scsi_target(sc->device));
1863 session = cls_session->dd_data; 1902 session = cls_session->dd_data;
1864 1903
1865 debug_scsi("LU Reset [sc %p lun %u]\n", sc, sc->device->lun); 1904 ISCSI_DBG_SESSION(session, "LU Reset [sc %p lun %u]\n",
1905 sc, sc->device->lun);
1866 1906
1867 mutex_lock(&session->eh_mutex); 1907 mutex_lock(&session->eh_mutex);
1868 spin_lock_bh(&session->lock); 1908 spin_lock_bh(&session->lock);
@@ -1916,8 +1956,8 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
1916unlock: 1956unlock:
1917 spin_unlock_bh(&session->lock); 1957 spin_unlock_bh(&session->lock);
1918done: 1958done:
1919 debug_scsi("iscsi_eh_device_reset %s\n", 1959 ISCSI_DBG_SESSION(session, "dev reset result = %s\n",
1920 rc == SUCCESS ? "SUCCESS" : "FAILED"); 1960 rc == SUCCESS ? "SUCCESS" : "FAILED");
1921 mutex_unlock(&session->eh_mutex); 1961 mutex_unlock(&session->eh_mutex);
1922 return rc; 1962 return rc;
1923} 1963}
@@ -2466,14 +2506,16 @@ flush_control_queues(struct iscsi_session *session, struct iscsi_conn *conn)
2466 2506
2467 /* handle pending */ 2507 /* handle pending */
2468 list_for_each_entry_safe(task, tmp, &conn->mgmtqueue, running) { 2508 list_for_each_entry_safe(task, tmp, &conn->mgmtqueue, running) {
2469 debug_scsi("flushing pending mgmt task itt 0x%x\n", task->itt); 2509 ISCSI_DBG_SESSION(session, "flushing pending mgmt task "
2510 "itt 0x%x\n", task->itt);
2470 /* release ref from prep task */ 2511 /* release ref from prep task */
2471 __iscsi_put_task(task); 2512 __iscsi_put_task(task);
2472 } 2513 }
2473 2514
2474 /* handle running */ 2515 /* handle running */
2475 list_for_each_entry_safe(task, tmp, &conn->mgmt_run_list, running) { 2516 list_for_each_entry_safe(task, tmp, &conn->mgmt_run_list, running) {
2476 debug_scsi("flushing running mgmt task itt 0x%x\n", task->itt); 2517 ISCSI_DBG_SESSION(session, "flushing running mgmt task "
2518 "itt 0x%x\n", task->itt);
2477 /* release ref from prep task */ 2519 /* release ref from prep task */
2478 __iscsi_put_task(task); 2520 __iscsi_put_task(task);
2479 } 2521 }
@@ -2523,7 +2565,7 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
2523 conn->datadgst_en = 0; 2565 conn->datadgst_en = 0;
2524 if (session->state == ISCSI_STATE_IN_RECOVERY && 2566 if (session->state == ISCSI_STATE_IN_RECOVERY &&
2525 old_stop_stage != STOP_CONN_RECOVER) { 2567 old_stop_stage != STOP_CONN_RECOVER) {
2526 debug_scsi("blocking session\n"); 2568 ISCSI_DBG_SESSION(session, "blocking session\n");
2527 iscsi_block_session(session->cls_session); 2569 iscsi_block_session(session->cls_session);
2528 } 2570 }
2529 } 2571 }