diff options
Diffstat (limited to 'drivers/scsi/iscsi_tcp.c')
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index db47158e0dde..453a740fa68e 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -684,10 +684,8 @@ static int iscsi_sw_tcp_conn_set_param(struct iscsi_cls_conn *cls_conn, | |||
684 | int buflen) | 684 | int buflen) |
685 | { | 685 | { |
686 | struct iscsi_conn *conn = cls_conn->dd_data; | 686 | struct iscsi_conn *conn = cls_conn->dd_data; |
687 | struct iscsi_session *session = conn->session; | ||
688 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; | 687 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; |
689 | struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data; | 688 | struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data; |
690 | int value; | ||
691 | 689 | ||
692 | switch(param) { | 690 | switch(param) { |
693 | case ISCSI_PARAM_HDRDGST_EN: | 691 | case ISCSI_PARAM_HDRDGST_EN: |
@@ -699,16 +697,7 @@ static int iscsi_sw_tcp_conn_set_param(struct iscsi_cls_conn *cls_conn, | |||
699 | sock_no_sendpage : tcp_sw_conn->sock->ops->sendpage; | 697 | sock_no_sendpage : tcp_sw_conn->sock->ops->sendpage; |
700 | break; | 698 | break; |
701 | case ISCSI_PARAM_MAX_R2T: | 699 | case ISCSI_PARAM_MAX_R2T: |
702 | sscanf(buf, "%d", &value); | 700 | return iscsi_tcp_set_max_r2t(conn, buf); |
703 | if (value <= 0 || !is_power_of_2(value)) | ||
704 | return -EINVAL; | ||
705 | if (session->max_r2t == value) | ||
706 | break; | ||
707 | iscsi_tcp_r2tpool_free(session); | ||
708 | iscsi_set_param(cls_conn, param, buf, buflen); | ||
709 | if (iscsi_tcp_r2tpool_alloc(session)) | ||
710 | return -ENOMEM; | ||
711 | break; | ||
712 | default: | 701 | default: |
713 | return iscsi_set_param(cls_conn, param, buf, buflen); | 702 | return iscsi_set_param(cls_conn, param, buf, buflen); |
714 | } | 703 | } |