summaryrefslogtreecommitdiff
path: root/drivers/scsi/osd
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2018-10-15 08:51:39 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2018-10-16 01:13:35 -0400
commitaa73237dcb2d96d7a3292af8ca943dd149fd39af (patch)
treeec0f6674cca301aae23ba040075810c3c30ea46e /drivers/scsi/osd
parent81b6ca6dbada186d0d41c67db8d8eb223a64a56f (diff)
scsi: target/core: Always call transport_complete_callback() upon failure
COMPARE AND WRITE command execution starts with a call of sbc_compare_and_write(). That function locks the caw_sem member in the backend device data structure and submits a read request to the backend driver. Upon successful completion of the read compare_and_write_callback() gets called. That last function compares the data that has been read. If it matches transport_complete_callback is set to compare_and_write_post and a write request is submitted. compare_and_write_post() submits a write request to the backend driver. XDWRITEREAD command execution starts with sbc_execute_rw() submitting a read to the backend device. Upon successful completion of the read the xdreadwrite_callback() gets called. That function xors the data that has been read with the data in the data-out buffer and stores the result in the data-in buffer. Call transport_complete_callback() not only if COMPARE AND WRITE fails but also if XDWRITEREAD fails. This makes the code more systematic. Make sure that the callback functions handle (cmd, false, NULL) argument triples fine. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org> Cc: Mike Christie <mchristi@redhat.com> Cc: Hannes Reinecke <hare@suse.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/osd')
0 files changed, 0 insertions, 0 deletions