hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Fri Aug 4 15:11:15 PDT 2006


 hald/linux2/blockdev.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletion(-)

New commits:
diff-tree 5248f077b0ff0087c0d37464713ee36febeee189 (from 57a4df10e1d8d2919d2fc2ad358bbfd0de702953)
Author: David Zeuthen <davidz at redhat.com>
Date:   Fri Aug 4 18:10:47 2006 -0400

    sleep before looking for slaves/ in sysfs for device mapper
    
    Also make a note that this is a hack and that it can go away once the
    patch for device mapper in the kernel emitted "changed" is in a
    relased kernel.

diff --git a/hald/linux2/blockdev.c b/hald/linux2/blockdev.c
index bffc4e8..37fa9dc 100644
--- a/hald/linux2/blockdev.c
+++ b/hald/linux2/blockdev.c
@@ -793,6 +793,20 @@ hotplug_event_begin_add_blockdev (const 
 		GError *err = NULL;
 		char path[HAL_PATH_MAX];
 
+
+		/* sleep one second since device mapper needs additional
+		 * time before the device file is ready
+		 *
+		 * this is a hack and will only affect device mapper block
+		 * devices. It can go away once the kernel emits a "changed"
+		 * event for the device file (this is about to go upstream)
+		 * and we can depend on a released kernel with this feature.
+		 */
+		if (strncmp (hal_util_get_last_element (sysfs_path), "dm-", 3) == 0) {
+			HAL_INFO (("Waiting 1000ms to wait for device mapper to be ready", path));
+			usleep (1000 * 1000);
+		}
+
 		g_snprintf (path, HAL_PATH_MAX, "%s/slaves", sysfs_path);
 		HAL_INFO (("Looking in %s", path));
 		if ((dir = g_dir_open (path, 0, &err)) == NULL) {
@@ -810,7 +824,7 @@ hotplug_event_begin_add_blockdev (const 
 
 				if (target != NULL) {
 					HalDevice *slave_volume;
-					
+
 					slave_volume = hal_device_store_match_key_value_string (hald_get_gdl (),
 												"linux.sysfs_path", 
 												target);



More information about the hal-commit mailing list