From 7230a63d5564e78ee61000cf5fc816d21d454a94 Mon Sep 17 00:00:00 2001 From: Martin Pitt 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