> + /* > + * Here the previously allocated SGLs for the XCOPY are mapped zero-copy > + * to the internal READ or WRITE. > + */ This comments is rather pointless and a little confusing. I'd use the chance to kill it rather than bringing it over from the previous code. > + sense_rc = transport_generic_map_mem_to_cmd(cmd, > + xop->xop_data_sg, xop->xop_data_nents, > + NULL, 0); > + if (sense_rc) { > + ret = -EINVAL; > + goto out; > } This could simply be: if (transport_generic_map_mem_to_cmd(cmd, xop->xop_data_sg, xop->xop_data_nents, NULL, 0)) return -EINVAL; > + rc = target_alloc_sgl(&xop->xop_data_sg, > + &xop->xop_data_nents, > + cur_bytes, > + false, false); > + if (rc < 0) { > + goto out; > + } rc = target_alloc_sgl(&xop->xop_data_sg, &xop->xop_data_nents, cur_bytes, false, false); if (rc < 0) goto out; Otherwise looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>