diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2015-04-14 15:08:13 (GMT) |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-04-15 20:07:12 (GMT) |
commit | a065fe6aa25ba6ba93c02dc13486131bb3c64d5f (patch) | |
tree | 1f947568457fe28015a016373baedc0212ff315c | |
parent | 30bf1d58ae8e87fef20248c7166777deab0d7f9c (diff) | |
download | linux-a065fe6aa25ba6ba93c02dc13486131bb3c64d5f.tar.xz |
IB/iser: Fix wrong calculation of protection buffer length
This length miss-calculation may cause a silent data corruption
in the DIX case and cause the device to reference unmapped area.
Fixes: d77e65350f2d ('libiscsi, iser: Adjust data_length to include protection information')
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_initiator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index 20e859a..76eb57b 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c @@ -409,8 +409,8 @@ int iser_send_command(struct iscsi_conn *conn, if (scsi_prot_sg_count(sc)) { prot_buf->buf = scsi_prot_sglist(sc); prot_buf->size = scsi_prot_sg_count(sc); - prot_buf->data_len = data_buf->data_len >> - ilog2(sc->device->sector_size) * 8; + prot_buf->data_len = (data_buf->data_len >> + ilog2(sc->device->sector_size)) * 8; } if (hdr->flags & ISCSI_FLAG_CMD_READ) { |