From patchwork Tue Aug 27 05:53:01 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: 270024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 65CCA2C009E for ; Tue, 27 Aug 2013 15:53:37 +1000 (EST) Received: from localhost ([::1]:54272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VECDc-0007Fy-Ir for incoming@patchwork.ozlabs.org; Tue, 27 Aug 2013 01:53:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VECDE-00071w-UH for qemu-devel@nongnu.org; Tue, 27 Aug 2013 01:53:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VECD6-000388-0Y for qemu-devel@nongnu.org; Tue, 27 Aug 2013 01:53:08 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:48196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VECD5-00031q-39 for qemu-devel@nongnu.org; Tue, 27 Aug 2013 01:52:59 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2013 11:12:27 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 27 Aug 2013 11:12:26 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 07842394004E for ; Tue, 27 Aug 2013 11:22:36 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7R5sJw429753560 for ; Tue, 27 Aug 2013 11:24:24 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7R5qeYV014252 for ; Tue, 27 Aug 2013 11:22:41 +0530 Received: from bharata.in.ibm.com ([9.124.35.67]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r7R5qem4014246; Tue, 27 Aug 2013 11:22:40 +0530 From: Bharata B Rao To: qemu-devel@nongnu.org Date: Tue, 27 Aug 2013 11:23:01 +0530 Message-Id: <1377582781-640-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: 13082705-5816-0000-0000-000009986044 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.2 Cc: kwolf@redhat.com, pbonzini@redhat.com, asias@redhat.com, stefanha@redhat.com, Bharata B Rao Subject: [Qemu-devel] [PATCH] 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 --- block/gluster.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index 46f36f8..942154a 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"); + abort(); } }