tcm/pscsi: Fix failure case for __pscsi_map_task_SG()
Subsystems (2)
PATCH 1/1 tcm/pscsi: Fix failure case for __pscsi_map_task_SG()
From: Nicholas Bellinger <[email protected]>
The 'ret' value in __pscsi_map_task_SG() needs to be set to the failure code that will be handled in transport_generic_new_cmd() as each struct se_task->transport_map_task() is executed. This patch fixes the pSCSI se_task map_task_SG() callers to return the OUT_OF_MEMORY macro from target_core_transport.h to signal a failure and build the necessary sense data.
It also changes bio_add_pc_page() to use 'rc' to make this slightly less confusing..
Signed-off-by Nicholas A. Bellinger <[email protected]>
--- drivers/target/target_core_pscsi.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/target/target_core_pscsi.c +3 -3
@@ -1057,7 +1057,7 @@ static int __pscsi_map_task_SG(u32 data_len = task->task_size, i, len, bytes, off;int nr_pages = (task->task_size + task_sg[0 ].offset +PAGE_SIZE -1 ) >>PAGE_SHIFT ; -int nr_vecs =0 , ret =0 ; +int nr_vecs =0 , rc, ret =PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES ;int rw = (TASK_CMD (task)->data_direction ==DMA_TO_DEVICE );if (!task->task_size)
@@ -1119,9 +1119,9 @@ static int __pscsi_map_task_SG(" bio: %p page: %p len: %d off: %d\n" , i, bio, page, len, off); - ret =bio_add_pc_page (pdv->pdv_sd->request_queue, + rc =bio_add_pc_page (pdv->pdv_sd->request_queue, bio, page, bytes, off); -if (ret != bytes) +if (rc != bytes) goto fail; DEBUG_PSCSI("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n",
Signature · 1 line
1.5.6.5