From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUGGR-0003H3-IX for qemu-devel@nongnu.org; Tue, 15 May 2012 07:50:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUGGM-00053A-TP for qemu-devel@nongnu.org; Tue, 15 May 2012 07:50:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUGGM-000532-LX for qemu-devel@nongnu.org; Tue, 15 May 2012 07:49:58 -0400 Message-ID: <4FB242D1.7040705@redhat.com> Date: Tue, 15 May 2012 13:49:37 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <87vcjx1y7k.fsf@rho.meyering.net> <4FB23F3E.4000700@redhat.com> In-Reply-To: <4FB23F3E.4000700@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] posix-aio: don't set aiocb->ret/active outside critical section List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Frediano Ziglio , Anthony Liguori , Jim Meyering , Stefan Hajnoczi , qemu-devel@nongnu.org Il 15/05/2012 13:34, Kevin Wolf ha scritto: >> static void qemu_paio_submit(struct qemu_paiocb *aiocb) >> { >> + mutex_lock(&lock); >> aiocb->ret = -EINPROGRESS; >> aiocb->active = 0; >> - mutex_lock(&lock); >> if (idle_threads == 0 && cur_threads < max_threads) >> spawn_thread(); >> QTAILQ_INSERT_TAIL(&request_list, aiocb, node); >> mutex_unlock(&lock); >> cond_signal(&cond); >> } > > This is just silencing coverity, not really fixing a bug, right? aiocb > is inserted into request_lists only afterwards, and before it is in the > list, other threads can't find it. Indeed... I don't like the patch, the access is out of the lock for a reason. Paolo