HAL

Merge lp:~chrisccoulson/hal/bug361689 into lp:~ubuntu-core-dev/hal/ubuntu

Proposed by Chris Coulson
Status: Merged
Merged at revision: not available
Proposed branch: lp:~chrisccoulson/hal/bug361689
Merge into: lp:~ubuntu-core-dev/hal/ubuntu
Diff against target: None lines
To merge this branch: bzr merge lp:~chrisccoulson/hal/bug361689
To post a comment you must log in.

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 2009-05-04 18:40:47 +0000
3+++ debian/changelog 2009-05-06 19:25:50 +0000
4@@ -1,3 +1,13 @@
5+hal (0.5.12~rc1+git20090406.46dc48-2ubuntu4) karmic; urgency=low
6+
7+ * debian/patches/50_no_crash_on_md_blockdev.patch:
8+ - When adding a block device, don't assume that the parent
9+ has storage capability. This fixes a crash where the device
10+ is re-parented to the root computer device object (such as
11+ with mdraid devices). LP: #361689.
12+
13+ -- Chris Coulson <chrisccoulson@googlemail.com> Wed, 06 May 2009 19:34:49 +0100
14+
15 hal (0.5.12~rc1+git20090406.46dc48-2ubuntu3) karmic; urgency=low
16
17 * debian/control:
18
19=== added file 'debian/patches/50_no_crash_on_md_blockdev.patch'
20--- debian/patches/50_no_crash_on_md_blockdev.patch 1970-01-01 00:00:00 +0000
21+++ debian/patches/50_no_crash_on_md_blockdev.patch 2009-05-06 19:25:50 +0000
22@@ -0,0 +1,41 @@
23+# DP: When adding a block device, don't assume that the parent has storage
24+# DP: capability. This fixes a crash where the device is re-parented to the
25+# DP: root computer device object (such as with mdraid devices)
26+# Launchpad: https://bugs.launchpad.net/ubuntu/+source/hal/+bug/361689
27+# Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=21603
28+
29+Index: hal-0.5.12~rc1+git20090406.46dc48/hald/linux/blockdev.c
30+===================================================================
31+--- hal-0.5.12~rc1+git20090406.46dc48.orig/hald/linux/blockdev.c 2009-05-06 19:33:33.000000000 +0100
32++++ hal-0.5.12~rc1+git20090406.46dc48/hald/linux/blockdev.c 2009-05-06 19:53:43.000000000 +0100
33+@@ -1498,8 +1498,15 @@
34+ hal_device_property_set_bool (d, "volume.is_mounted", FALSE);
35+ hal_device_property_set_bool (d, "volume.is_mounted_read_only", FALSE);
36+ hal_device_property_set_bool (d, "volume.linux.is_device_mapper", is_device_mapper);
37+- hal_device_property_set_bool (d, "volume.is_disc", strcmp (hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0);
38+-
39++ /* Don't assume that the parent has storage capability, eg
40++ * if we are an MD partition then this is the case as we were
41++ * re-parented to the root computer device object earlier.
42++ */
43++ if (hal_device_has_property(parent, "storage.drive_type")) {
44++ hal_device_property_set_bool (d, "volume.is_disc", strcmp (hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0);
45++ } else {
46++ hal_device_property_set_bool (d, "volume.is_disc", FALSE);
47++ }
48+
49+ is_physical_partition = TRUE;
50+ if (is_fakevolume || is_device_mapper)
51+@@ -1508,8 +1515,10 @@
52+ hal_device_property_set_bool (d, "volume.is_partition", is_physical_partition);
53+
54+ hal_device_property_set_string (d, "info.category", "volume");
55+- if (strcmp(hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0) {
56+- hal_device_add_capability (d, "volume.disc");
57++ if (hal_device_has_property(parent, "storage.drive_type")) {
58++ if (strcmp(hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0) {
59++ hal_device_add_capability (d, "volume.disc");
60++ }
61+ }
62+ hal_device_add_capability (d, "volume");
63+ hal_device_add_capability (d, "block");
64
65=== modified file 'debian/patches/series'
66--- debian/patches/series 2009-05-04 18:40:47 +0000
67+++ debian/patches/series 2009-05-06 19:25:50 +0000
68@@ -7,3 +7,4 @@
69 40_readme_remove_hacking.patch
70 11-direct-hal-set-propery.patch
71 ubuntu_01_ignore_single_slash_label.patch
72+50_no_crash_on_md_blockdev.patch

Subscribers

People subscribed via source and target branches

to all changes: