From: Ned Bass Date: Fri, 1 Apr 2011 16:47:05 +0000 (-0700) Subject: Call udevadm trigger more safely X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;h=fa417e57a68b7aa026ec5fd8c0471b6c60ca109f;hp=fa417e57a68b7aa026ec5fd8c0471b6c60ca109f;p=zfs.git Call udevadm trigger more safely Some udev hooks are not designed to be idempotent, so calling udevadm trigger outside of the distribution's initialization scripts can have unexpected (and potentially dangerous) side effects. For example, the system time may change or devices may appear multiple times. See Ubuntu launchpad bug 320200 and this mailing list post for more details: https://lists.ubuntu.com/archives/ubuntu-devel/2009-January/027260.html To avoid these problems we call udevadm trigger with --action=change --subsystem-match=block. The first argument tells udev just to refresh devices, and make sure everything's as it should be. The second argument limits the scope to block devices, so devices belonging to other subsystems cannot be affected. This doesn't fix the problem on older udev implementations that don't provide udevadm but instead have udevtrigger as a standalone program. In this case the above options aren't available so there's no way to call call udevtrigger safely. But we can live with that since this issue only exists in optional test and helper scripts, and most zfs-on-linux users are running newer systems anyways. ---