]> sourceware.org Git - lvm2.git/commitdiff
Replacei sleep wait with udev settle
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 28 Jan 2011 16:12:45 +0000 (16:12 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 28 Jan 2011 16:12:45 +0000 (16:12 +0000)
Use new udev_wait command instead of unpredictable sleep waiting.
As with more devices in the system, udev processing is slower.

test/t-pvcreate-operation-md.sh

index a844e32fc042a37fffb63ac69b63cedecdf2a8dd..5085ce1414dfbd448034a635cce2845ec5554820 100644 (file)
@@ -34,8 +34,9 @@ mdadm_maj=$(mdadm --version 2>&1 | perl -pi -e 's|.* v(\d+).*|\1|')
 cleanup_md() {
     # sleeps offer hack to defeat: 'md: md127 still in use'
     # see: https://bugzilla.redhat.com/show_bug.cgi?id=509908#c25
-    sleep 2
+    aux udev_wait
     mdadm --stop $mddev || true
+    aux udev_wait
     if [ -b "$mddev" ]; then
         # mdadm doesn't always cleanup the device node
        sleep 2
@@ -102,6 +103,11 @@ EOF
     base_mddev_p=`basename $mddev_p_sysfs_name`
     mddev_p=/dev/${base_mddev_p}
 
+    # in case the system is running without devtmpfs /dev
+    # wait here for created device node on tmpfs
+    aux udev_wait $mddev_p
+    test -b $mddev_p || exit 200
+
     # Checking for 'alignment_offset' in sysfs implies Linux >= 2.6.31
     # but reliable alignment_offset support requires kernel.org Linux >= 2.6.33
     sysfs_alignment_offset=/sys/dev/block/${mddev_maj_min}/${base_mddev_p}/alignment_offset
This page took 0.035565 seconds and 5 git commands to generate.