On Tue, 2011-10-18 at 06:57 -0400, Christoph Hellwig wrote: > plain text document attachment (target-kill-task_sg_bidi) > This field is never used given that BIDI handling happens at the > command and not the task level. Remove it and the dead code in > pscsi that tries to work on it. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > Actually, thats not completely true. This code was originally created to support BIDI operation for XDWRITEREAD passthrough into PSCSI -> scsi_debug which is done on a per se_task basis. This is different from how we handle the non pSCSI cases, which ends up generating individual tasks for BIDI operation instead of a single task passed into multiple blk_make_request() calls. So we ended up breaking the pSCSI BIDI handling at some point during the v3.1 heavy lifting, but considering the obscurity involved here I'm OK to merge this patch to get rid of the left-overs.. There's one additional place where pSCSI passthrough will need to reject BIDI, and I'll include that as a seperate patch. (Boaz, any reason objection to removing this..?) Also, i'm running into an issue with IBLOCk BIDI operations now with the latest code. Unfortunately aside from sgv4_xdwrite_read from Tomo's sgv4-tools.git this code gets minimal testing, but this should be fixed shortly.. --nab > Index: lio-core/drivers/target/target_core_pscsi.c > =================================================================== > --- lio-core.orig/drivers/target/target_core_pscsi.c 2011-10-18 12:04:03.941357058 +0200 > +++ lio-core/drivers/target/target_core_pscsi.c 2011-10-18 12:04:36.669854377 +0200 > @@ -1095,32 +1095,6 @@ static int pscsi_do_task(struct se_task > pr_err("pSCSI: blk_make_request() failed\n"); > goto fail; > } > - > - if (task->task_sg_bidi) { > - /* > - * If present, set up the extra BIDI-COMMAND SCSI READ > - * struct request and payload. > - */ > - ret = pscsi_map_sg(task, task->task_sg_bidi, &hbio); > - if (ret < 0) { > - /* XXX: free the main request? */ > - return PYX_TRANSPORT_LU_COMM_FAILURE; > - } > - > - /* > - * Setup the secondary pt->pscsi_req->next_rq used for the extra > - * BIDI READ payload. > - */ > - req->next_rq = blk_make_request(pdv->pdv_sd->request_queue, > - hbio, GFP_KERNEL); > - if (!req) { > - pr_err("pSCSI: blk_make_request() failed for BIDI\n"); > - /* XXX: free the main request? */ > - goto fail; > - } > - > - req->next_rq->cmd_type = REQ_TYPE_BLOCK_PC; > - } > } > > req->cmd_type = REQ_TYPE_BLOCK_PC; > @@ -1240,12 +1214,6 @@ static void pscsi_req_done(struct reques > pt->pscsi_resid = req->resid_len; > > pscsi_process_SAM_status(task, pt); > - /* > - * Release BIDI-READ if present > - */ > - if (req->next_rq != NULL) > - __blk_put_request(req->q, req->next_rq); > - > __blk_put_request(req->q, req); > } > > Index: lio-core/drivers/target/target_core_transport.c > =================================================================== > --- lio-core.orig/drivers/target/target_core_transport.c 2011-10-18 12:04:04.968357621 +0200 > +++ lio-core/drivers/target/target_core_transport.c 2011-10-18 12:04:36.673858642 +0200 > @@ -3535,7 +3535,6 @@ static void transport_free_dev_tasks(str > */ > del_timer_sync(&task->task_timer); > > - kfree(task->task_sg_bidi); > kfree(task->task_sg); > > list_del(&task->t_list); > Index: lio-core/include/target/target_core_base.h > =================================================================== > --- lio-core.orig/include/target/target_core_base.h 2011-10-18 12:04:03.969352355 +0200 > +++ lio-core/include/target/target_core_base.h 2011-10-18 12:04:36.677920786 +0200 > @@ -397,7 +397,6 @@ struct se_task { > u32 task_size; > struct se_cmd *task_se_cmd; > struct scatterlist *task_sg; > - struct scatterlist *task_sg_bidi; > u32 task_sg_nents; > u16 task_flags; > u8 task_sense; > > -- > To unsubscribe from this list: send the line "unsubscribe target-devel" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html