[qemu-xen master] block/iscsi: dont leave allocmap in an invalid state on UNMAP failure

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

[qemu-xen master] block/iscsi: dont leave allocmap in an invalid state on UNMAP failure

patchbot
commit fd89d93e85df641d8110a2774591b9c9b63dad9b
Author:     Peter Lieven <[hidden email]>
AuthorDate: Fri Dec 8 12:51:07 2017 +0100
Commit:     Michael Roth <[hidden email]>
CommitDate: Mon Jan 8 07:40:25 2018 -0600

    block/iscsi: dont leave allocmap in an invalid state on UNMAP failure
   
    we forgot to set the allocmap to invalid if an UNMAP call fails.
   
    Cc: [hidden email]
    Signed-off-by: Peter Lieven <[hidden email]>
    Message-Id: <[hidden email]>
    Reviewed-by: Eric Blake <[hidden email]>
    Signed-off-by: Paolo Bonzini <[hidden email]>
    (cherry picked from commit aef172ffdc2f9c41d9cc043a55f1259e7c07e587)
    Signed-off-by: Michael Roth <[hidden email]>
---
 block/iscsi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 4683f3b..c532ec7 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -2,7 +2,7 @@
  * QEMU Block driver for iSCSI images
  *
  * Copyright (c) 2010-2011 Ronnie Sahlberg <[hidden email]>
- * Copyright (c) 2012-2016 Peter Lieven <[hidden email]>
+ * Copyright (c) 2012-2017 Peter Lieven <[hidden email]>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -1128,6 +1128,9 @@ retry:
         goto retry;
     }
 
+    iscsi_allocmap_set_invalid(iscsilun, offset >> BDRV_SECTOR_BITS,
+                               bytes >> BDRV_SECTOR_BITS);
+
     if (iTask.status == SCSI_STATUS_CHECK_CONDITION) {
         /* the target might fail with a check condition if it
            is not happy with the alignment of the UNMAP request
@@ -1140,9 +1143,6 @@ retry:
         goto out_unlock;
     }
 
-    iscsi_allocmap_set_invalid(iscsilun, offset >> BDRV_SECTOR_BITS,
-                               bytes >> BDRV_SECTOR_BITS);
-
 out_unlock:
     qemu_mutex_unlock(&iscsilun->mutex);
     return r;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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