From patchwork Fri Aug 16 23:16:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1148530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 469Khs3rJXz9s7T for ; Sat, 17 Aug 2019 09:46:19 +1000 (AEST) Received: from localhost ([::1]:33514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hylvE-00067R-5S for incoming@patchwork.ozlabs.org; Fri, 16 Aug 2019 19:46:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47620) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hylSB-0001bO-Nt for qemu-devel@nongnu.org; Fri, 16 Aug 2019 19:16:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hylSA-0007qi-Jn for qemu-devel@nongnu.org; Fri, 16 Aug 2019 19:16:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55404) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hylSA-0007qF-Ei; Fri, 16 Aug 2019 19:16:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BDDEF30A5686; Fri, 16 Aug 2019 23:16:13 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-187.bos.redhat.com [10.18.17.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26ED917BB9; Fri, 16 Aug 2019 23:16:13 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Date: Fri, 16 Aug 2019 19:16:08 -0400 Message-Id: <20190816231609.9521-3-jsnow@redhat.com> In-Reply-To: <20190816231609.9521-1-jsnow@redhat.com> References: <20190816231609.9521-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 16 Aug 2019 23:16:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/3] Revert "ide/ahci: Check for -ECANCELED in aio callbacks" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Shaju Abraham , jsnow@redhat.com, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Signed-off-by: John Snow Message-id: 20190729223605.7163-1-jsnow@redhat.com Signed-off-by: John Snow --- hw/ide/ahci.c | 3 --- hw/ide/core.c | 14 -------------- 2 files changed, 17 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index d72da85605a..d45393c019d 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -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; diff --git a/hw/ide/core.c b/hw/ide/core.c index 38b6cdac87b..e6e54c6c9a2 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -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)) {