Skip to contentSkip to conversation

iscsi: Don't set error if already set in iscsi_do_inquiry

PATCH Applied Fam Zheng 4 participants 4 messages Apr 4, 2014 Block layer

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 iscsi: Don't set error if already set in iscsi_do_inquiry

This eliminates the possible assertion failure in error_setg().

---
 block/iscsi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
block/iscsi.c +4 -2
index 21c18a3..64a509f 100644
@@ -1101,8 +1101,10 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,
     return task;
 
 fail:
-    error_setg(errp, "iSCSI: Inquiry command failed : %s",
-               iscsi_get_error(iscsi));
+    if (!error_is_set(errp)) {
+        error_setg(errp, "iSCSI: Inquiry command failed : %s",
+                   iscsi_get_error(iscsi));
+    }
     if (task != NULL) {
         scsi_free_scsi_task(task);
     }
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw

Il 04/04/2014 13:53, Fam Zheng ha scritto:

Quoted 15 lines

This eliminates the possible assertion failure in error_setg().

---
 block/iscsi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
block/iscsi.c +0 -0
index 21c18a3..64a509f 100644
@@ -1101,8 +1101,10 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,
     return task;
 

block/iscsi.c static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun, · line 1110

Quoted 10 lines
block/iscsi.c +4 -2
 fail:
-    error_setg(errp, "iSCSI: Inquiry command failed : %s",
-               iscsi_get_error(iscsi));
+    if (!error_is_set(errp)) {
+        error_setg(errp, "iSCSI: Inquiry command failed : %s",
+                   iscsi_get_error(iscsi));
+    }
     if (task != NULL) {
         scsi_free_scsi_task(task);
     }

Kevin, Stefan, can you send the pull request for this?

Paolo

Applied
#2 lore raw

Am 04.04.2014 um 13:57 hat Paolo Bonzini geschrieben:

Quoted 29 lines

Il 04/04/2014 13:53, Fam Zheng ha scritto:

Quoted 16 lines

This eliminates the possible assertion failure in error_setg().

---
block/iscsi.c | 6 ++++--

1 file changed, 4 insertions(+), 2 deletions(-)
block/iscsi.c +0 -0
index 21c18a3..64a509f 100644
@@ -1101,8 +1101,10 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,
    return task;
 

fail:

block/iscsi.c static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun, · line 1110

Quoted 9 lines
block/iscsi.c +4 -2
-    error_setg(errp, "iSCSI: Inquiry command failed : %s",
-               iscsi_get_error(iscsi));
+    if (!error_is_set(errp)) {
+        error_setg(errp, "iSCSI: Inquiry command failed : %s",
+                   iscsi_get_error(iscsi));
+    }
    if (task != NULL) {
        scsi_free_scsi_task(task);
    }
Quoted 1 line

Kevin, Stefan, can you send the pull request for this?

Thanks, applied to the block branch.

Kevin