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

Proposed by Serge Hallyn
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) Approve
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.
Revision history for this message
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...

Revision history for this message
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
Revision history for this message
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".

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

Subscribers

People subscribed via source and target branches