On 17/08/2017 14:03, Fam Zheng wrote: > On Thu, 08/17 13:44, Paolo Bonzini wrote: >> On 17/08/2017 12:28, Fam Zheng wrote: >>> This makes the werror/rerror options available on the scsi-block device, >>> to allow user specify error handling policy in the same way as scsi-hd >>> etc. >>> >>> Signed-off-by: Fam Zheng <f...@redhat.com> >> >> I'm not sure this is enough, because you would only obey the >> rerror/werror action if ioctl fails, not if the ioctl succeeds but the >> command fails (the "r->status && *r->status" conditional in >> scsi_disk_req_check_error). > > Yes, I missed that. Why isn't scsi_handle_rw_error called in that if block > currently?
A recursive answer is because scsi-block doesn't have rerror and werror (and it's the only one that sets r->status, see scsi_block_dma_command). More precisely, scsi_handle_rw_error more or less assumes error != 0 (see the switch statement and blk_error_action), so some other changes are needed to cover that case---at least not overwrite the sense and ensure something sensible comes out of the QMP event. Paolo