Re: [PATCH-v2 12/12] xen-scsiback: Convert to TARGET_SCF_ACK_KREF I/O krefs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2016-01-26 at 10:49 +0100, Juergen Gross wrote:
> On 25/01/16 09:11, Nicholas A. Bellinger wrote:
> > From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> > 
> > Cc: Juergen Gross <jgross@xxxxxxxx>
> > Cc: Hannes Reinecke <hare@xxxxxxx>
> > Cc: David Vrabel <david.vrabel@xxxxxxxxxx>
> > Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> > ---
> >  drivers/xen/xen-scsiback.c | 53 +++++++++++++++++++++++-----------------------
> >  1 file changed, 26 insertions(+), 27 deletions(-)
> > 
> > diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
> > index 640fb22..a10e5f1 100644
> > --- a/drivers/xen/xen-scsiback.c
> > +++ b/drivers/xen/xen-scsiback.c
> > @@ -381,6 +381,12 @@ static void scsiback_cmd_done(struct vscsibk_pend *pending_req)
> >  	scsiback_do_resp_with_sense(sense_buffer, errors, resid, pending_req,
> >  				    pending_req->rqid);
> >  	scsiback_put(info);
> > +	/*
> > +	 * Drop the extra KREF_ACK reference taken by target_submit_cmd_map_sgls()
> > +	 * ahead of scsiback_check_stop_free() ->  transport_generic_free_cmd()
> > +	 * final se_cmd->cmd_kref put.
> > +	 */
> > +	target_put_sess_cmd(&pending_req->se_cmd);
> >  }
> >  
> >  static void scsiback_cmd_exec(struct vscsibk_pend *pending_req)
> > @@ -398,7 +404,7 @@ static void scsiback_cmd_exec(struct vscsibk_pend *pending_req)
> >  	rc = target_submit_cmd_map_sgls(se_cmd, sess, pending_req->cmnd,
> >  			pending_req->sense_buffer, pending_req->v2p->lun,
> >  			pending_req->data_len, 0,
> > -			pending_req->sc_data_direction, 0,
> > +			pending_req->sc_data_direction, TARGET_SCF_ACK_KREF,
> >  			pending_req->sgl, pending_req->n_sg,
> >  			NULL, 0, NULL, 0);
> >  	if (rc < 0) {
> > @@ -587,31 +593,28 @@ static void scsiback_disconnect(struct vscsibk_info *info)
> >  static void scsiback_device_action(struct vscsibk_pend *pending_req,
> >  	enum tcm_tmreq_table act, int tag)
> >  {
> > -	int rc, err = FAILED;
> >  	struct scsiback_tpg *tpg = pending_req->v2p->tpg;
> > +	struct scsiback_nexus *nexus = tpg->tpg_nexus;
> >  	struct se_cmd *se_cmd = &pending_req->se_cmd;
> >  	struct scsiback_tmr *tmr;
> > +	u64 unpacked_lun = pending_req->v2p->lun;
> > +	int rc, err = FAILED;
> >  
> >  	tmr = kzalloc(sizeof(struct scsiback_tmr), GFP_KERNEL);
> > -	if (!tmr)
> > -		goto out;
> > +	if (!tmr) {
> > +		target_put_sess_cmd(se_cmd);
> > +		goto err;
> 
> Sure? I think this should still be "goto out;"?
> 
> > +	}
> >  
> >  	init_waitqueue_head(&tmr->tmr_wait);
> >  
> > -	transport_init_se_cmd(se_cmd, tpg->se_tpg.se_tpg_tfo,
> > -		tpg->tpg_nexus->tvn_se_sess, 0, DMA_NONE, TCM_SIMPLE_TAG,
> > -		&pending_req->sense_buffer[0]);
> > -
> > -	rc = core_tmr_alloc_req(se_cmd, tmr, act, GFP_KERNEL);
> > -	if (rc < 0)
> > -		goto out;
> > -
> > -	se_cmd->se_tmr_req->ref_task_tag = tag;
> > +	rc = target_submit_tmr(&pending_req->se_cmd, nexus->tvn_se_sess,
> > +			       &pending_req->sense_buffer[0],
> > +			       unpacked_lun, tmr, act, GFP_KERNEL,
> > +			       tag, TARGET_SCF_ACK_KREF);
> > +	if (rc)
> > +		goto err;
> 
> Again.
> 

Whoops, bisect breakage here..

Fixed up this in latest target-pending/queue-next.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux