aboutsummaryrefslogtreecommitdiff
blob: 76b1d3a1a365461a774b4d92d0d59ee1a4c451ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 7230a63d5564e78ee61000cf5fc816d21d454a94 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Sun, 10 Aug 2008 15:52:36 +0200
Subject: [PATCH 10/48] volume.num_blocks can become larger than 2G

Fix mounting of devices with a very large number of reported blocks by
making it a 64 bit property.  (https://launchpad.net/bugs/209483)
---
 hald/linux/blockdev.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
index 6042558..d88a815 100644
--- a/hald/linux/blockdev.c
+++ b/hald/linux/blockdev.c
@@ -1436,13 +1436,13 @@ hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const gchar *device_f
 		 * (block size requires opening the device file)
 		 */
 		hal_device_property_set_int (d, "volume.block_size", 512);
-		if (!hal_util_set_int_from_file (d, "volume.num_blocks", sysfs_path_real, "size", 0)) {
+		if (!hal_util_set_uint64_from_file (d, "volume.num_blocks", sysfs_path_real, "size", 0)) {
 			HAL_INFO (("Ignoring hotplug event - cannot read 'size'"));
 			goto error;
 		}
 		hal_device_property_set_uint64 (
 			d, "volume.size",
-			((dbus_uint64_t)(512)) * ((dbus_uint64_t)(hal_device_property_get_int (d, "volume.num_blocks"))));
+			((dbus_uint64_t)(512)) * ((dbus_uint64_t)(hal_device_property_get_uint64 (d, "volume.num_blocks"))));
 		/* TODO: move to prober? */
 		if (is_physical_partition) {
 			guint64 start_block;
-- 
1.6.1.2