From patchwork Tue Aug 27 08:15:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharata B Rao X-Patchwork-Id: 270061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8A82D2C009A for ; Tue, 27 Aug 2013 18:16:19 +1000 (EST) Received: from localhost ([::1]:54776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEERl-0001zN-N2 for incoming@patchwork.ozlabs.org; Tue, 27 Aug 2013 04:16:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEERL-0001yo-L0 for qemu-devel@nongnu.org; Tue, 27 Aug 2013 04:16:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEERC-0002DE-BD for qemu-devel@nongnu.org; Tue, 27 Aug 2013 04:15:51 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:36421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEERB-0002Ct-Hs for qemu-devel@nongnu.org; Tue, 27 Aug 2013 04:15:42 -0400 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2013 18:12:14 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 27 Aug 2013 18:12:11 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 970FF2CE804C for ; Tue, 27 Aug 2013 18:15:27 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7R7xMkT51839058 for ; Tue, 27 Aug 2013 17:59:22 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7R8FQKj030457 for ; Tue, 27 Aug 2013 18:15:26 +1000 Received: from bharata.in.ibm.com ([9.124.35.67]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r7R8FH4v030119; Tue, 27 Aug 2013 18:15:25 +1000 From: Bharata B Rao To: qemu-devel@nongnu.org Date: Tue, 27 Aug 2013 13:45:41 +0530 Message-Id: <1377591341-2417-1-git-send-email-bharata@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.11.7 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13082708-5140-0000-0000-000003BB90AB X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.141 Cc: kwolf@redhat.com, pbonzini@redhat.com, asias@redhat.com, stefanha@redhat.com, Bharata B Rao Subject: [Qemu-devel] [PATCH v1] gluster: Abort on AIO completion failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently if gluster AIO callback thread fails to notify the QEMU thread about AIO completion, we try graceful recovery by marking the disk drive as inaccessible. This error recovery code is race-prone as found by Asias and Stefan. However as found out by Paolo, this kind of error is impossible and hence simplify the code that handles this error recovery. Signed-off-by: Bharata B Rao Reviewed-by: Stefan Hajnoczi --- Changes in v1: Print errno information. block/gluster.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index 46f36f8..dbb03f4 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -427,20 +427,9 @@ static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg) /* * Gluster AIO callback thread failed to notify the waiting * QEMU thread about IO completion. - * - * Complete this IO request and make the disk inaccessible for - * subsequent reads and writes. */ - error_report("Gluster failed to notify QEMU about IO completion"); - - qemu_mutex_lock_iothread(); /* We are in gluster thread context */ - acb->common.cb(acb->common.opaque, -EIO); - qemu_aio_release(acb); - close(s->fds[GLUSTER_FD_READ]); - close(s->fds[GLUSTER_FD_WRITE]); - qemu_aio_set_fd_handler(s->fds[GLUSTER_FD_READ], NULL, NULL, NULL); - bs->drv = NULL; /* Make the disk inaccessible */ - qemu_mutex_unlock_iothread(); + error_report("Gluster AIO completion failed: %s", strerror(errno)); + abort(); } }