aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_iscsi.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2011-10-06 04:56:59 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-20 11:12:44 -0400
commit00c31889f7513e9ffa6b2b4de8ad6d7f59a61c80 (patch)
tree6ba665724a1aed89f962598c323af9be18ce5688 /drivers/scsi/scsi_transport_iscsi.c
parent88f4f5170fe74ae28443f304fcd226ddcf84f592 (diff)
[SCSI] qla4xxx: fix data alignment and use nl helpers
This has the driver use helpers for a common operation and fixes a issue where if multiple iscsi params are sent they could be sent at offsets that cause unaligned accesses. The nla helpers account for the padding needed to align properly for the driver. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 522423bdcb56..142a09a3afbf 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1890,7 +1890,7 @@ iscsi_set_path(struct iscsi_transport *transport, struct iscsi_uevent *ev)
1890 1890
1891static int 1891static int
1892iscsi_set_iface_params(struct iscsi_transport *transport, 1892iscsi_set_iface_params(struct iscsi_transport *transport,
1893 struct iscsi_uevent *ev) 1893 struct iscsi_uevent *ev, uint32_t len)
1894{ 1894{
1895 char *data = (char *)ev + sizeof(*ev); 1895 char *data = (char *)ev + sizeof(*ev);
1896 struct Scsi_Host *shost; 1896 struct Scsi_Host *shost;
@@ -1906,8 +1906,7 @@ iscsi_set_iface_params(struct iscsi_transport *transport,
1906 return -ENODEV; 1906 return -ENODEV;
1907 } 1907 }
1908 1908
1909 err = transport->set_iface_param(shost, data, 1909 err = transport->set_iface_param(shost, data, len);
1910 ev->u.set_iface_params.count);
1911 scsi_host_put(shost); 1910 scsi_host_put(shost);
1912 return err; 1911 return err;
1913} 1912}
@@ -2052,7 +2051,8 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
2052 err = iscsi_set_path(transport, ev); 2051 err = iscsi_set_path(transport, ev);
2053 break; 2052 break;
2054 case ISCSI_UEVENT_SET_IFACE_PARAMS: 2053 case ISCSI_UEVENT_SET_IFACE_PARAMS:
2055 err = iscsi_set_iface_params(transport, ev); 2054 err = iscsi_set_iface_params(transport, ev,
2055 nlmsg_attrlen(nlh, sizeof(*ev)));
2056 break; 2056 break;
2057 default: 2057 default:
2058 err = -ENOSYS; 2058 err = -ENOSYS;