From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWpvs-0002qH-Q4 for qemu-devel@nongnu.org; Mon, 08 Aug 2016 15:09:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWpvr-0005Nh-9i for qemu-devel@nongnu.org; Mon, 08 Aug 2016 15:09:52 -0400 From: John Snow Date: Mon, 8 Aug 2016 15:09:36 -0400 Message-Id: <1470683381-16680-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH 0/5] blockjobs: Fix transactional race condition List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, jcody@redhat.com, vsementsov@virtuozzo.com, famz@redhat.com, qemu-devel@nongnu.org, John Snow There are a few problems with transactional job completion right now. First, if jobs complete so quickly they complete before remaining jobs get a chance to join the transaction, the completion mode can leave well known state and the QLIST can get corrupted and the transactional jobs can complete in batches or phases instead of all together. Second, if two or more jobs defer to the main loop at roughly the same time, it's possible for one job's cleanup to directly invoke the other job's cleanup from within the same thread, leading to a situation that will deadlock the entire transaction. Thanks to Vladimir for pointing out these modes of failure. ________________________________________________________________________________ For convenience, this branch is available at: https://github.com/jnsnow/qemu.git branch job-manual-start https://github.com/jnsnow/qemu/tree/job-manual-start This version is tagged job-manual-start-v1: https://github.com/jnsnow/qemu/releases/tag/job-manual-start-v1 John Snow (4): blockjob: add block_job_start blockjob: refactor backup_start as backup_job_create blockjob: add .clean property iotests: add transactional failure race test Vladimir Sementsov-Ogievskiy (1): blockjob: fix dead pointer in txn list block/backup.c | 50 +++++++----- block/commit.c | 2 +- block/mirror.c | 2 +- block/stream.c | 2 +- blockdev.c | 194 ++++++++++++++++++++++++++------------------- blockjob.c | 24 +++++- include/block/block_int.h | 19 ++--- include/block/blockjob.h | 16 ++++ tests/qemu-iotests/124 | 91 +++++++++++++++++++++ tests/qemu-iotests/124.out | 4 +- tests/test-blockjob-txn.c | 2 +- 11 files changed, 284 insertions(+), 122 deletions(-) -- 2.7.4