Merge lp:~serge-hallyn/ubuntu/lucid/qemu-kvm/fix-scsi-writeback into lp:ubuntu/lucid/qemu-kvm

Proposed by Serge Hallyn on 2010-08-07
Status: Merged
Merge reported by: James Westby
Merged at revision: not available
Proposed branch: lp:~serge-hallyn/ubuntu/lucid/qemu-kvm/fix-scsi-writeback
Merge into: lp:ubuntu/lucid/qemu-kvm
Diff against target: 98 lines (+78/-0)
3 files modified
debian/changelog (+6/-0)
debian/patches/scsi-Dequeue-requests-before-invoking-completion-callback.patch (+71/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~serge-hallyn/ubuntu/lucid/qemu-kvm/fix-scsi-writeback
Reviewer Review Type Date Requested Status
Thierry Carrez (community) 2010-08-07 Approve on 2010-08-23
Review via email: mp+32036@code.launchpad.net

Description of the change

This is a fix for LP #595438

To post a comment you must log in.
Thierry Carrez (ttx) wrote :

Looks good, however before this can be committed there should be an SRU report on bug 595438. This allows the SRU team to assess impact vs. regression risk, and give a testcase for the lucid-proposed testers. See https://wiki.ubuntu.com/StableReleaseUpdates#Procedure for details...

Thierry Carrez (ttx) wrote :

Version should be "0.12.3+noroms-0ubuntu9.3" and target pocket "lucid-proposed". I'll make the corresponding changes and upload.

review: Approve
Thierry Carrez (ttx) wrote :

Hmm, cannot chnage status to "Merged", probably because it should have been proposed for merging into lucid-proposed and not "lucid".

Thierry Carrez (ttx) wrote :

Uploaded to lucid-proposed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-04-23 18:45:55 +0000
3+++ debian/changelog 2010-08-07 17:51:48 +0000
4@@ -1,3 +1,9 @@
5+qemu-kvm (0.12.3+noroms-0ubuntu10) lucid; urgency=low
6+
7+ * Fix segfault when using scsi with writeback (LP: #595438)
8+
9+ -- Serge Hallyn <serge.hallyn@canonical.com> Wed, 28 Jul 2010 09:56:56 -0500
10+
11 qemu-kvm (0.12.3+noroms-0ubuntu9) lucid; urgency=low
12
13 * Architecture-specific fixes (LP: #568904)
14
15=== added file 'debian/patches/scsi-Dequeue-requests-before-invoking-completion-callback.patch'
16--- debian/patches/scsi-Dequeue-requests-before-invoking-completion-callback.patch 1970-01-01 00:00:00 +0000
17+++ debian/patches/scsi-Dequeue-requests-before-invoking-completion-callback.patch 2010-08-07 17:51:48 +0000
18@@ -0,0 +1,71 @@
19+commit e8637c9013609271772cc0c3436cb1240cd6b034
20+Author: Jan Kiszka <jan.kiszka@siemens.com>
21+Date: Tue Jul 13 14:13:45 2010 +0200
22+
23+ scsi: Dequeue requests before invoking completion callback
24+
25+ The request completion callback of the LSI controller may start the next
26+ request that can use the same tag as the completed one. As the latter is
27+ still enqueued at that point, scsi_send_command will complain about the
28+ tag reuse and cancel the completed request. That will cause a double
29+ free later on when the completion path cleans up as well.
30+
31+ Fix this by dequeuing the request before invoking the callback.
32+
33+ Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
34+ Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
35+
36+Origin: upstream, http://git.savannah.gnu.org/cgit/qemu.git/commit/?id=e8637c9013609271772cc0c3436cb1240cd6b034
37+Bug-ubuntu: https://bugs.launchpad.net/qemu-kvm/+bug/595438
38+
39+Index: fix-scsi/hw/scsi-bus.c
40+===================================================================
41+--- fix-scsi.orig/hw/scsi-bus.c 2010-07-28 09:49:02.000000000 -0500
42++++ fix-scsi/hw/scsi-bus.c 2010-07-28 09:55:42.222916455 -0500
43+@@ -133,6 +133,7 @@
44+ req->tag = tag;
45+ req->lun = lun;
46+ req->status = -1;
47++ req->enqueued = true;
48+ QTAILQ_INSERT_TAIL(&d->requests, req, next);
49+ return req;
50+ }
51+@@ -149,9 +150,17 @@
52+ return NULL;
53+ }
54+
55++static void scsi_req_dequeue(SCSIRequest *req)
56++{
57++ if (req->enqueued) {
58++ QTAILQ_REMOVE(&req->dev->requests, req, next);
59++ req->enqueued = false;
60++ }
61++}
62++
63+ void scsi_req_free(SCSIRequest *req)
64+ {
65+- QTAILQ_REMOVE(&req->dev->requests, req, next);
66++ scsi_req_dequeue(req);
67+ qemu_free(req);
68+ }
69+
70+@@ -492,6 +501,7 @@
71+ void scsi_req_complete(SCSIRequest *req)
72+ {
73+ assert(req->status != -1);
74++ scsi_req_dequeue(req);
75+ req->bus->complete(req->bus, SCSI_REASON_DONE,
76+ req->tag,
77+ req->status);
78+Index: fix-scsi/hw/scsi.h
79+===================================================================
80+--- fix-scsi.orig/hw/scsi.h 2010-07-28 09:49:02.000000000 -0500
81++++ fix-scsi/hw/scsi.h 2010-07-28 09:55:42.222916455 -0500
82+@@ -42,6 +42,7 @@
83+ enum SCSIXferMode mode;
84+ } cmd;
85+ BlockDriverAIOCB *aiocb;
86++ bool enqueued;
87+ QTAILQ_ENTRY(SCSIRequest) next;
88+ } SCSIRequest;
89+
90
91=== modified file 'debian/patches/series'
92--- debian/patches/series 2010-04-01 00:22:02 +0000
93+++ debian/patches/series 2010-08-07 17:51:48 +0000
94@@ -9,3 +9,4 @@
95 arm-higher-initrd-load-address.patch
96 larger_default_ram_size.patch
97 SDL-wrong-behaviour-of-caps-lock.patch
98+scsi-Dequeue-requests-before-invoking-completion-callback.patch

Subscribers

People subscribed via source and target branches