Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread Bart Van Assche
On 05/26/14 17:27, James Bottomley wrote: On Mon, 2014-05-26 at 17:15 +0200, Bart Van Assche wrote: Make it possible to test the REQ_ATOM_COMPLETE bit from outside the block layer core. I don't see the value of patches 2,3 they're checking for an impossible condition ... why might it be

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread h...@infradead.org
On Tue, May 27, 2014 at 09:49:48AM +0200, Bart Van Assche wrote: I don't see the value of patches 2,3 they're checking for an impossible condition ... why might it be possible? When reading the source code in scsi_error.c it's easy to overlook that scmd_eh_abort_handler(),

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread James Bottomley
On Tue, 2014-05-27 at 09:49 +0200, Bart Van Assche wrote: On 05/26/14 17:27, James Bottomley wrote: On Mon, 2014-05-26 at 17:15 +0200, Bart Van Assche wrote: Make it possible to test the REQ_ATOM_COMPLETE bit from outside the block layer core. I don't see the value of patches 2,3

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread Bart Van Assche
On 05/27/14 10:23, James Bottomley wrote: On Tue, 2014-05-27 at 09:49 +0200, Bart Van Assche wrote: When reading the source code in scsi_error.c it's easy to overlook that scmd_eh_abort_handler(), scsi_abort_command() and scsi_eh_scmd_add() are all invoked for requests in which the

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread James Bottomley
On Tue, 2014-05-27 at 11:00 +0200, Bart Van Assche wrote: On 05/27/14 10:23, James Bottomley wrote: On Tue, 2014-05-27 at 09:49 +0200, Bart Van Assche wrote: When reading the source code in scsi_error.c it's easy to overlook that scmd_eh_abort_handler(), scsi_abort_command() and

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread Paolo Bonzini
Il 27/05/2014 12:21, James Bottomley ha scritto: I could also see us one day extending the TMF capability to abort any running command, which would make even an assertion of block timed out or completed invalid. Actually the assertion would remain valid, and that's exactly what Bart wants to

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread James Bottomley
On Tue, 2014-05-27 at 12:47 +0200, Paolo Bonzini wrote: Il 27/05/2014 12:21, James Bottomley ha scritto: I could also see us one day extending the TMF capability to abort any running command, which would make even an assertion of block timed out or completed invalid. Actually the

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread Paolo Bonzini
Il 27/05/2014 12:59, James Bottomley ha scritto: On Tue, 2014-05-27 at 12:47 +0200, Paolo Bonzini wrote: Il 27/05/2014 12:21, James Bottomley ha scritto: I could also see us one day extending the TMF capability to abort any running command, which would make even an assertion of block timed out

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread Paolo Bonzini
Il 27/05/2014 13:26, James Bottomley ha scritto: You could use a different mechanism than a softirq to tell the abort were successful, for example by overriding scsi_done. But with respect to the block layer, the mechanics of avoiding the race and double-free would probably be the same. I

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread James Bottomley
On Tue, 2014-05-27 at 13:52 +0200, Paolo Bonzini wrote: Il 27/05/2014 13:26, James Bottomley ha scritto: You could use a different mechanism than a softirq to tell the abort were successful, for example by overriding scsi_done. But with respect to the block layer, the mechanics of avoiding

[PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-26 Thread Bart Van Assche
Make it possible to test the REQ_ATOM_COMPLETE bit from outside the block layer core. Signed-off-by: Bart Van Assche bvanass...@acm.org Cc: Jens Axboe ax...@fb.com Cc: Hannes Reinecke h...@suse.de Cc: Paolo Bonzini pbonz...@redhat.com Cc: Christoph Hellwig h...@infradead.org Cc: Joe Lawrence

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-26 Thread Hannes Reinecke
On 05/26/2014 05:15 PM, Bart Van Assche wrote: Make it possible to test the REQ_ATOM_COMPLETE bit from outside the block layer core. Signed-off-by: Bart Van Assche bvanass...@acm.org Cc: Jens Axboe ax...@fb.com Cc: Hannes Reinecke h...@suse.de Cc: Paolo Bonzini pbonz...@redhat.com Cc: Christoph