From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCVTX-0000QH-HB for qemu-devel@nongnu.org; Thu, 22 Aug 2013 10:03:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCVTO-0003Hx-KE for qemu-devel@nongnu.org; Thu, 22 Aug 2013 10:02:59 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:52305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCVTM-0003G9-Ng for qemu-devel@nongnu.org; Thu, 22 Aug 2013 10:02:50 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Aug 2013 19:22:28 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 07AAFE005A for ; Thu, 22 Aug 2013 19:33:07 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7ME2XQV43974880 for ; Thu, 22 Aug 2013 19:32:33 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7ME1ZEa019230 for ; Thu, 22 Aug 2013 19:31:36 +0530 Date: Thu, 22 Aug 2013 19:31:48 +0530 From: Bharata B Rao Message-ID: <20130822140147.GD2755@in.ibm.com> References: <5214DF5B.50203@redhat.com> <20130822055947.GB24870@in.ibm.com> <20130822074846.GC10412@stefanha-thinkpad.redhat.com> <5215D4A7.60501@redhat.com> <20130822095542.GA2755@in.ibm.com> <5215E150.7000800@redhat.com> <20130822102829.GB2755@in.ibm.com> <5215F2EF.4060106@redhat.com> <20130822132551.GC2755@in.ibm.com> <521611C7.7040809@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <521611C7.7040809@redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: Fix race in gluster_finish_aiocb Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Vijay Bellur , Stefan Hajnoczi , qemu-devel@nongnu.org, Stefan Hajnoczi , Asias He , MORITA Kazutaka On Thu, Aug 22, 2013 at 03:27:35PM +0200, Paolo Bonzini wrote: > >>>> Looking at write(2), it looks like it is impossible > >>>> > >>>> EAGAIN or EWOULDBLOCK > >>>> can't happen, blocking file descriptor > >>>> > >>>> EBADF, EPIPE > >>>> shouldn't happen since the device is drained before > >>>> calling qemu_gluster_close. > >>>> > >>>> EDESTADDRREQ, EDQUOT, EFBIG, EIO, ENOSPC > >>>> cannot happen for pipes > >>>> > >>>> EFAULT > >>>> abort would be fine > >>> > >>> In the case where we have separate system and data disks and if error (EFAULT) > >>> happens for the data disk, don't we want to keep the VM up by gracefully > >>> disabling IO to the data disk ? > >> > >> EFAULT means the buffer address is invalid, I/O error would be EIO, but... > >> > >>> I remember this was one of the motivations to > >>> handle this failure. > >> > >> ... this write is on the pipe, not on a disk. > > > > Right. Failure to complete the write on the pipe means that IO done to the > > disk didn't complete and hence to the VM it is essentially a disk IO failure. > > The question is, can the write to the pipe actually fail? Not just "in > practice not" according to the documented errors, it seems to me that it > cannot. May be I am dragging this a bit, but since we are at it, let me make one last observation here :) The buffer in question here is the GlusterAIOCB pointer that gets passed back and forth between QEMU and gluster thro' glfs_pwritev_async and associated callback gluster_finish_aiocb. Isn't there a possibility that gluster will not give us back the same pointer during callback due to some errors on the gluster side ? Unlikely but possible ? Regards, Bharata.