Round up the data allocation for the bidi read buffer, but store the true length in the scsi_data_buffer for use by devices. Signed-off-by: Pete Wyckoff <pw at osc.edu> --- usr/iscsi/iscsid.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c index 1b19b35..502ab1e 100644 --- a/usr/iscsi/iscsid.c +++ b/usr/iscsi/iscsid.c @@ -1163,10 +1163,11 @@ static int iscsi_target_cmd_queue(struct iscsi_task *task) dprintf("bidi read len %u\n", in_length); if (in_length) { + uint32_t len; void *buf; - in_length = roundup(in_length, 4); - buf = conn->tp->alloc_data_buf(conn, in_length); + len = roundup(in_length, 4); + buf = conn->tp->alloc_data_buf(conn, len); if (!buf) return -ENOMEM; -- 1.5.3.4 |