[qemu-xen master] scsi-disk: release AioContext in unaligned WRITE SAME case

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[qemu-xen master] scsi-disk: release AioContext in unaligned WRITE SAME case

patchbot
commit ccf82aee58424418845c881e1db5ca6d03918112
Author:     Stefan Hajnoczi <[hidden email]>
AuthorDate: Thu Jan 4 14:25:02 2018 +0000
Commit:     Michael Roth <[hidden email]>
CommitDate: Tue Jan 23 16:35:01 2018 -0600

    scsi-disk: release AioContext in unaligned WRITE SAME case
   
    scsi_write_same_complete() can retry the write if the request was
    unaligned.  Make sure to release the AioContext when that code path is
    taken!
   
    This patch fixes a hang when QEMU terminates after an unaligned WRITE
    SAME request has been processed with dataplane.  The hang occurs because
    iothread_stop_all() cannot acquire the AioContext lock that was leaked
    by the IOThread in scsi_write_same_complete().
   
    Fixes: b9e413dd37 ("block: explicitly acquire aiocontext in aio callbacks that need it").
    Cc: Paolo Bonzini <[hidden email]>
    Cc: [hidden email]
    Reported-by: Cong Li <[hidden email]>
    Signed-off-by: Stefan Hajnoczi <[hidden email]>
    Message-Id: <[hidden email]>
    Signed-off-by: Paolo Bonzini <[hidden email]>
    (cherry picked from commit 24355b79bdaf6ab12f7c610b032fc35ec045cd55)
    Signed-off-by: Michael Roth <[hidden email]>
---
 hw/scsi/scsi-disk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 1243117..5e4d2c3 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -1755,6 +1755,7 @@ static void scsi_write_same_complete(void *opaque, int ret)
                                        data->sector << BDRV_SECTOR_BITS,
                                        &data->qiov, 0,
                                        scsi_write_same_complete, data);
+        aio_context_release(blk_get_aio_context(s->qdev.conf.blk));
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog