All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, stefanha@redhat.com,
	pbonzini@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org,
	John Snow <jsnow@redhat.com>
Subject: [Qemu-devel] [PATCH v4 1/6] blockjob: fix dead pointer in txn list
Date: Tue,  8 Nov 2016 01:50:34 -0500	[thread overview]
Message-ID: <1478587839-9834-2-git-send-email-jsnow@redhat.com> (raw)
In-Reply-To: <1478587839-9834-1-git-send-email-jsnow@redhat.com>

From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

Though it is not intended to be reached through normal circumstances,
if we do not gracefully deconstruct the transaction QLIST, we may wind
up with stale pointers in the list.

The rest of this series attempts to address the underlying issues,
but this should fix list inconsistencies.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tested-by: John Snow <jsnow@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
[Rewrote commit message. --js]
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>

Signed-off-by: John Snow <jsnow@redhat.com>
---
 blockjob.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/blockjob.c b/blockjob.c
index 4aa14a4..4d0ef53 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -256,6 +256,7 @@ static void block_job_completed_single(BlockJob *job)
     }
 
     if (job->txn) {
+        QLIST_REMOVE(job, txn_list);
         block_job_txn_unref(job->txn);
     }
     block_job_unref(job);
-- 
2.7.4

  reply	other threads:[~2016-11-08  6:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08  6:50 [Qemu-devel] [PATCH v4 0/6] jobs: fix transactional race condition John Snow
2016-11-08  6:50 ` John Snow [this message]
2016-11-08  6:50 ` [Qemu-devel] [PATCH v4 2/6] blockjob: add .clean property John Snow
2016-11-08  6:50 ` [Qemu-devel] [PATCH v4 3/6] blockjob: add .start field John Snow
2016-11-08  6:50 ` [Qemu-devel] [PATCH v4 4/6] blockjob: add block_job_start John Snow
2016-11-09 16:18   ` Jeff Cody
2016-11-08  6:50 ` [Qemu-devel] [PATCH v4 5/6] blockjob: refactor backup_start as backup_job_create John Snow
2016-11-09 16:19   ` Jeff Cody
2016-11-08  6:50 ` [Qemu-devel] [PATCH v4 6/6] iotests: add transactional failure race test John Snow
2016-11-09 16:11 ` [Qemu-devel] [PATCH v4 0/6] jobs: fix transactional race condition Jeff Cody
2016-11-09 16:21 ` Jeff Cody
2016-11-14 18:58 ` John Snow
2016-11-14 19:01   ` Jeff Cody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478587839-9834-2-git-send-email-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.