From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsqEo-0002uo-FQ for qemu-devel@nongnu.org; Mon, 24 Nov 2014 04:47:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XsqEh-0001By-RH for qemu-devel@nongnu.org; Mon, 24 Nov 2014 04:47:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsqEh-0001Bj-JK for qemu-devel@nongnu.org; Mon, 24 Nov 2014 04:47:11 -0500 Message-ID: <5472FE95.1090503@redhat.com> Date: Mon, 24 Nov 2014 10:47:01 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1415286601-30715-1-git-send-email-ming.lei@canonical.com> <1415286601-30715-2-git-send-email-ming.lei@canonical.com> <546B5551.6030208@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/3] linux-aio: fix submit aio as a batch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei Cc: Kevin Wolf , Peter Maydell , =?UTF-8?B?QmVub8OudCBDYW5ldA==?= , qemu-devel , Stefan Hajnoczi On 22/11/2014 13:16, Ming Lei wrote: > > > +static int ioq_enqueue(struct qemu_laio_state *s, struct iocb *iocb) > > > { > > > unsigned int idx = s->io_q.idx; > > > > > > + if (unlikely(idx == s->io_q.size)) { > > > + return -1; > > > > return -EAGAIN? > > It means the io queue is full, so the code has to fail the current > request. Right, but "-1" is "-EPERM" which doesn't make much sense. I think the right thing to do is to return EAGAIN, and let the owner figure it out. For example, a SCSI device might return a "BUSY" status code. Paolo