From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwzjX-0002Mk-Ci for qemu-devel@nongnu.org; Mon, 03 Sep 2018 21:02:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwzjV-0005a1-As for qemu-devel@nongnu.org; Mon, 03 Sep 2018 21:02:19 -0400 Date: Tue, 4 Sep 2018 09:02:04 +0800 From: Fam Zheng Message-ID: <20180904010204.GB28443@lemon.usersys.redhat.com> References: <20180824024342.749-1-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180824024342.749-1-famz@redhat.com> Subject: Re: [Qemu-devel] [Qemu-stable] [PATCH v2] job: Fix nested aio_poll() hanging in job_txn_apply List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, Jeff Cody , qemu-stable@nongnu.org, mreitz@redhat.com, pbonzini@redhat.com, eblake@redhat.com On Fri, 08/24 10:43, Fam Zheng wrote: > All callers have acquired ctx already. Doing that again results in > aio_poll() hang. This fixes the problem that a BDRV_POLL_WHILE() in the > callback cannot make progress because ctx is recursively locked, for > example, when drive-backup finishes. > > There are two callers of job_finalize(): > > fam@lemon:~/work/qemu [master]$ git grep -w -A1 '^\s*job_finalize' > blockdev.c: job_finalize(&job->job, errp); > blockdev.c- aio_context_release(aio_context); > -- > job-qmp.c: job_finalize(job, errp); > job-qmp.c- aio_context_release(aio_context); > -- > tests/test-blockjob.c: job_finalize(&job->job, &error_abort); > tests/test-blockjob.c- assert(job->job.status == JOB_STATUS_CONCLUDED); > > Ignoring the test, it's easy to see both callers to job_finalize (and > job_do_finalize) have acquired the context. > > Cc: qemu-stable@nongnu.org > Reported-by: Gu Nini > Reviewed-by: Eric Blake > Signed-off-by: Fam Zheng Ping?