Skip to content

Commit 8803837

Browse files
osc/rdma: fix iov size while unpacking result buffer
Set the iov length to target buffer size while unpacking the data to result buffer to avoid data corruption. Signed-off-by: Aboorva Devarajan <abodevar@in.ibm.com>
1 parent 849985e commit 8803837

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ static inline int ompi_osc_rdma_gacc_amo (ompi_osc_rdma_module_t *module, ompi_o
316316
if (NULL != result_convertor) {
317317
/* result buffer is not necessarily contiguous. use the opal datatype engine to
318318
* copy the data over in this case */
319-
struct iovec iov = {.iov_base = result_start, .iov_len = request->len};
319+
size_t len = count * dt_size;
320+
struct iovec iov = {.iov_base = result_start, .iov_len = len};
320321
uint32_t iov_count = 1;
321322
size_t size = request->len;
322323

0 commit comments

Comments
 (0)