iscsi changes for scsi-misc
Here are some cleanups and a small fix. Nothing in here is critical so they can go into scsi-misc.
The patchset was made over scsi-misc and this patch which
is not yet merged:
http://marc.info/?l=linux-scsi&m=127006425722598&w=2
(this patch is a bug fix that should go into scsi-rc-fixes if possible).
PATCH 1/4 iscsi_tcp: change & to &&
From: Dan Carpenter <[email protected]>
This change is basically a clean up.
datadgst_en is an int which comes from the user. I didn't see anything limiting it to 1 and 0 although obviously that's what it's supposed to be. If the user passed in 2 this test would fail.
This same if condition is repeated in another function and it uses && there.
--- drivers/scsi/libiscsi_tcp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/libiscsi_tcp.c +1 -1
@@ -421,7 +421,7 @@ iscsi_tcp_data_recv_prep(struct iscsi_tcp_conn *tcp_conn)struct iscsi_conn *conn = tcp_conn->iscsi_conn;struct hash_desc *rx_hash =NULL ; -if (conn->datadgst_en & +if (conn->datadgst_en && !(conn->session->tt->caps &CAP_DIGEST_OFFLOAD )) rx_hash = tcp_conn->rx_hash;
Signature · 1 line
1.6.6.1
PATCH 2/4 scsi_dh_emc: request flag cleanup
From: Mike Christie <[email protected]>
blk_get_request sets the cmd_flags, so we should not and do not need to set them. If we did set them to a different value then it can cause a oops in the elevator code.
--- drivers/scsi/device_handler/scsi_dh_emc.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/scsi/device_handler/scsi_dh_emc.c +0 -2
@@ -285,13 +285,11 @@ static struct request *get_req(struct scsi_device *sdev, int cmd,switch (cmd) {case MODE_SELECT : len =sizeof (short_trespass); - rq->cmd_flags |=REQ_RW ; rq->cmd[1 ] =0x10 ; rq->cmd[4 ] = len;break ;case MODE_SELECT_10 : len =sizeof (long_trespass); - rq->cmd_flags |=REQ_RW ; rq->cmd[1 ] =0x10 ; rq->cmd[8 ] = len;break ;
Signature · 1 line
1.6.6.1
PATCH 3/4 iscsi_tcp: Change iscsi_sw_tcp_conn_restore_callbacks arguments
From: Avi Kaplan <[email protected]>
This patch changes the arguments to iscsi_sw_tcp_conn_restore_callbacks, so that it works like the function to set the callbacks and because in upcoming patches we need a iscsi_conn.
--- drivers/scsi/iscsi_tcp.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/iscsi_tcp.c +4 -2
@@ -206,8 +206,10 @@ static void iscsi_sw_tcp_conn_set_callbacks(struct iscsi_conn *conn) }static void -iscsi_sw_tcp_conn_restore_callbacks (struct iscsi_sw_tcp_conn *tcp_sw_conn) +iscsi_sw_tcp_conn_restore_callbacks (struct iscsi_conn *conn) { +struct iscsi_tcp_conn *tcp_conn = conn->dd_data; +struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data;struct sock *sk = tcp_sw_conn->sock->sk;/* restore socket callbacks, see also: iscsi_conn_set_callbacks() */
@@ -555,7 +557,7 @@ static void iscsi_sw_tcp_release_conn(struct iscsi_conn *conn)return ;sock_hold (sock->sk); -iscsi_sw_tcp_conn_restore_callbacks (tcp_sw_conn); +iscsi_sw_tcp_conn_restore_callbacks (conn);sock_put (sock->sk);spin_lock_bh (&session->lock);
Signature · 1 line
1.6.6.1
PATCH 4/4 iscsi_tcp: Remove unused field iscsi_conn from struct iscsi_sw_tcp_conn
From: Avi Kaplan <[email protected]>
iscsi_conn is not used so remove it from iscsi_sw_tcp_conn.
--- drivers/scsi/iscsi_tcp.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/scsi/iscsi_tcp.h +0 -1
@@ -36,7 +36,6 @@ struct iscsi_sw_tcp_send { };struct iscsi_sw_tcp_conn { -struct iscsi_conn *iscsi_conn;struct socket *sock;struct iscsi_sw_tcp_send out;
Signature · 1 line
1.6.6.1