hal: Branch 'master'

Martin Pitt martin at kemper.freedesktop.org
Sun Aug 10 06:54:06 PDT 2008


 hald/linux/blockdev.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f7d7779d0fd2438479c9de4b8dd76f986941f0a4
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Sun Aug 10 15:52:36 2008 +0200

    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)

diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
index f00a2c2..369035d 100644
--- a/hald/linux/blockdev.c
+++ b/hald/linux/blockdev.c
@@ -1457,13 +1457,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;


More information about the hal-commit mailing list