Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-23 Thread Hannes Reinecke
On 05/23/2014 01:28 PM, Paolo Bonzini wrote: Il 23/05/2014 12:37, Bart Van Assche ha scritto: On 05/23/14 11:24, Paolo Bonzini wrote: Il 23/05/2014 08:09, Hannes Reinecke ha scritto: And when freeing a command we absolutely need to make sure that the workqueue is empty. So calling cancel_dela

Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-23 Thread Paolo Bonzini
Il 23/05/2014 12:37, Bart Van Assche ha scritto: On 05/23/14 11:24, Paolo Bonzini wrote: Il 23/05/2014 08:09, Hannes Reinecke ha scritto: And when freeing a command we absolutely need to make sure that the workqueue is empty. So calling cancel_delayed_work() was the obvious thing to do. You

Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-23 Thread Bart Van Assche
On 05/23/14 11:24, Paolo Bonzini wrote: > Il 23/05/2014 08:09, Hannes Reinecke ha scritto: >> >> And when freeing a command we absolutely need to make sure that >> the workqueue is empty. >> So calling cancel_delayed_work() was the obvious thing to do. > > You would need cancel_delayed_work_sync,

Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-23 Thread Paolo Bonzini
Il 23/05/2014 08:09, Hannes Reinecke ha scritto: And when freeing a command we absolutely need to make sure that the workqueue is empty. So calling cancel_delayed_work() was the obvious thing to do. You would need cancel_delayed_work_sync, but if it really happened that the work item is runni

Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-22 Thread Hannes Reinecke
On 05/21/2014 03:30 PM, Bart Van Assche wrote: scmd->abort_work is only scheduled after the block layer has marked the request associated with a command as complete and for commands that are not on the eh_cmd_q list. A SCSI command is only requeued after the scmd->abort_work handler has started (

Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-22 Thread Bart Van Assche
On 05/22/14 18:22, Paolo Bonzini wrote: > Il 21/05/2014 15:30, Bart Van Assche ha scritto: >> +static bool scmd_being_handled_in_other_context(struct scsi_cmnd *scmd) >> +{ >> +struct Scsi_Host *shost = scmd->device->host; >> +struct scsi_cmnd *c; >> +unsigned long flags; >> +bool r

Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-22 Thread Paolo Bonzini
Il 21/05/2014 15:30, Bart Van Assche ha scritto: +static bool scmd_being_handled_in_other_context(struct scsi_cmnd *scmd) +{ + struct Scsi_Host *shost = scmd->device->host; + struct scsi_cmnd *c; + unsigned long flags; + bool ret = false; + + if (!blk_rq_completed(sc

[PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-21 Thread Bart Van Assche
scmd->abort_work is only scheduled after the block layer has marked the request associated with a command as complete and for commands that are not on the eh_cmd_q list. A SCSI command is only requeued after the scmd->abort_work handler has started (requeueing clears the "complete" flag). This mean