]> Git Repo - qemu.git/commitdiff
Revert "ide/ahci: Check for -ECANCELED in aio callbacks"
authorJohn Snow <[email protected]>
Mon, 29 Jul 2019 22:36:05 +0000 (18:36 -0400)
committerJohn Snow <[email protected]>
Fri, 16 Aug 2019 23:14:04 +0000 (19:14 -0400)
This reverts commit 0d910cfeaf2076b116b4517166d5deb0fea76394.

It's not correct to just ignore an error code in a callback; we need to
handle that error and possible report failure to the guest so that they
don't wait indefinitely for an operation that will now never finish.

This ought to help cases reported by Nutanix where iSCSI returns a
legitimate -ECANCELED for certain operations which should be propagated
normally.

Reported-by: Shaju Abraham <[email protected]>
Signed-off-by: John Snow <[email protected]>
Message-id: 20190729223605[email protected]
Signed-off-by: John Snow <[email protected]>
hw/ide/ahci.c
hw/ide/core.c

index d72da85605afc7aa772119d8e85c1887536f8cce..d45393c019d0369077defe4c089d87a63e97d796 100644 (file)
@@ -1025,9 +1025,6 @@ static void ncq_cb(void *opaque, int ret)
     IDEState *ide_state = &ncq_tfs->drive->port.ifs[0];
 
     ncq_tfs->aiocb = NULL;
-    if (ret == -ECANCELED) {
-        return;
-    }
 
     if (ret < 0) {
         bool is_read = ncq_tfs->cmd == READ_FPDMA_QUEUED;
index 38b6cdac87b624613a4117fa48c09f7cc0f4c58b..e6e54c6c9a27cd1b6c8ebfe326ff0749670bdc37 100644 (file)
@@ -723,9 +723,6 @@ static void ide_sector_read_cb(void *opaque, int ret)
     s->pio_aiocb = NULL;
     s->status &= ~BUSY_STAT;
 
-    if (ret == -ECANCELED) {
-        return;
-    }
     if (ret != 0) {
         if (ide_handle_rw_error(s, -ret, IDE_RETRY_PIO |
                                 IDE_RETRY_READ)) {
@@ -841,10 +838,6 @@ static void ide_dma_cb(void *opaque, int ret)
     uint64_t offset;
     bool stay_active = false;
 
-    if (ret == -ECANCELED) {
-        return;
-    }
-
     if (ret == -EINVAL) {
         ide_dma_error(s);
         return;
@@ -976,10 +969,6 @@ static void ide_sector_write_cb(void *opaque, int ret)
     IDEState *s = opaque;
     int n;
 
-    if (ret == -ECANCELED) {
-        return;
-    }
-
     s->pio_aiocb = NULL;
     s->status &= ~BUSY_STAT;
 
@@ -1059,9 +1048,6 @@ static void ide_flush_cb(void *opaque, int ret)
 
     s->pio_aiocb = NULL;
 
-    if (ret == -ECANCELED) {
-        return;
-    }
     if (ret < 0) {
         /* XXX: What sector number to set here? */
         if (ide_handle_rw_error(s, -ret, IDE_RETRY_FLUSH)) {
This page took 0.032754 seconds and 4 git commands to generate.