Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df93ffcd748ce41e7b716c3056ae511939bb745e
Commit:     df93ffcd748ce41e7b716c3056ae511939bb745e
Parent:     118365721768f29d74718a59895ed7bd3c10b68e
Author:     Mike Christie <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 13 12:43:42 2007 -0600
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Jan 11 18:28:52 2008 -0600

    [SCSI] iscsi_tcp: fix setting of r2t
    
    If we negotiate for X r2ts we have to use only X r2ts. We cannot
    round up (we could send less though). It is ok to fail if it
    is not something the driver can handle, so this patch just does
    that.
    
    Signed-off-by: Mike Christie <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/iscsi_tcp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index edebdf2..e5be5fd 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -1774,12 +1774,12 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, 
enum iscsi_param param,
                break;
        case ISCSI_PARAM_MAX_R2T:
                sscanf(buf, "%d", &value);
-               if (session->max_r2t == roundup_pow_of_two(value))
+               if (value <= 0 || !is_power_of_2(value))
+                       return -EINVAL;
+               if (session->max_r2t == value)
                        break;
                iscsi_r2tpool_free(session);
                iscsi_set_param(cls_conn, param, buf, buflen);
-               if (session->max_r2t & (session->max_r2t - 1))
-                       session->max_r2t = roundup_pow_of_two(session->max_r2t);
                if (iscsi_r2tpool_alloc(session))
                        return -ENOMEM;
                break;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to