Commit 55e3299d authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[SCSI] iscsi: fix 4k stack iscsi setups

When we run the xmit code from queuecomand the stack trace
gets too deep. The patch runs the xmit code from the scsi_host
work queue. This fixes 4k stack and xfs support and should
fix the st and sg stack usage bugs.
Signed-off-by: default avatarAlex Aizman <itn780@yahoo.com>
Signed-off-by: default avatarDmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 7b8631b5
...@@ -525,7 +525,7 @@ iscsi_r2t_rsp(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) ...@@ -525,7 +525,7 @@ iscsi_r2t_rsp(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
__kfifo_put(ctask->r2tqueue, (void*)&r2t, sizeof(void*)); __kfifo_put(ctask->r2tqueue, (void*)&r2t, sizeof(void*));
__kfifo_put(conn->writequeue, (void*)&ctask, sizeof(void*)); __kfifo_put(conn->writequeue, (void*)&ctask, sizeof(void*));
schedule_work(&conn->xmitwork); scsi_queue_work(session->host, &conn->xmitwork);
conn->r2t_pdus_cnt++; conn->r2t_pdus_cnt++;
spin_unlock(&session->lock); spin_unlock(&session->lock);
...@@ -1267,7 +1267,7 @@ iscsi_write_space(struct sock *sk) ...@@ -1267,7 +1267,7 @@ iscsi_write_space(struct sock *sk)
conn->old_write_space(sk); conn->old_write_space(sk);
debug_tcp("iscsi_write_space: cid %d\n", conn->id); debug_tcp("iscsi_write_space: cid %d\n", conn->id);
clear_bit(SUSPEND_BIT, &conn->suspend_tx); clear_bit(SUSPEND_BIT, &conn->suspend_tx);
schedule_work(&conn->xmitwork); scsi_queue_work(conn->session->host, &conn->xmitwork);
} }
static void static void
...@@ -2275,7 +2275,7 @@ iscsi_xmitworker(void *data) ...@@ -2275,7 +2275,7 @@ iscsi_xmitworker(void *data)
*/ */
mutex_lock(&conn->xmitmutex); mutex_lock(&conn->xmitmutex);
if (iscsi_data_xmit(conn)) if (iscsi_data_xmit(conn))
schedule_work(&conn->xmitwork); scsi_queue_work(conn->session->host, &conn->xmitwork);
mutex_unlock(&conn->xmitmutex); mutex_unlock(&conn->xmitmutex);
} }
...@@ -2340,15 +2340,7 @@ iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) ...@@ -2340,15 +2340,7 @@ iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
session->cmdsn, session->max_cmdsn - session->exp_cmdsn + 1); session->cmdsn, session->max_cmdsn - session->exp_cmdsn + 1);
spin_unlock(&session->lock); spin_unlock(&session->lock);
if (!in_interrupt() && mutex_trylock(&conn->xmitmutex)) { scsi_queue_work(host, &conn->xmitwork);
spin_unlock_irq(host->host_lock);
if (iscsi_data_xmit(conn))
schedule_work(&conn->xmitwork);
mutex_unlock(&conn->xmitmutex);
spin_lock_irq(host->host_lock);
} else
schedule_work(&conn->xmitwork);
return 0; return 0;
reject: reject:
...@@ -2942,8 +2934,7 @@ iscsi_conn_send_generic(struct iscsi_conn *conn, struct iscsi_hdr *hdr, ...@@ -2942,8 +2934,7 @@ iscsi_conn_send_generic(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
else else
__kfifo_put(conn->mgmtqueue, (void*)&mtask, sizeof(void*)); __kfifo_put(conn->mgmtqueue, (void*)&mtask, sizeof(void*));
schedule_work(&conn->xmitwork); scsi_queue_work(session->host, &conn->xmitwork);
return 0; return 0;
} }
......
...@@ -379,6 +379,7 @@ iscsi_transport_create_session(struct scsi_transport_template *scsit, ...@@ -379,6 +379,7 @@ iscsi_transport_create_session(struct scsi_transport_template *scsit,
shost->max_lun = transport->max_lun; shost->max_lun = transport->max_lun;
shost->max_cmd_len = transport->max_cmd_len; shost->max_cmd_len = transport->max_cmd_len;
shost->transportt = scsit; shost->transportt = scsit;
shost->transportt->create_work_queue = 1;
if (scsi_add_host(shost, NULL)) if (scsi_add_host(shost, NULL))
goto free_host; goto free_host;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment