summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-11-12 09:33:17 -0800
committerBrian Behlendorf <[email protected]>2010-11-12 09:33:17 -0800
commit5e7affae52365f9f329cc63a53ae570352c4d993 (patch)
treeccb2487e86b5a07cfb311b9eae36d0940aebd618
parente0f3df67e5174cd51284f0c26779046facfc95e0 (diff)
Skip /dev/hpet during 'zpool import'zfs-0.5.2
If libblkid does not contain ZFS support, then 'zpool import' will scan all block devices in /dev/ to determine which ones are components of a ZFS filesystem. It does this by opening all the devices and stat'ing them to determine which ones are block devices. If the device turns out not to be a block device it is skipped. Usually, this whole process is pretty harmless (although slow). But there are certain devices in /dev/ which must be handled in a very specific way or your system may crash. For example, if /dev/watchdog is simply opened the watchdog timer will be started and your system will panic when the timer expires. It turns out the /dev/hpet causes similiar problems although only when accessed under a virtual machine. For some reason accessing /dev/hpet causes qemu to crash. To address this issue this commit adds /dev/hpet to the device blacklist, it will be skipped solely based on its name.
-rw-r--r--lib/libzfs/libzfs_import.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c
index ee0064892..8668583b2 100644
--- a/lib/libzfs/libzfs_import.c
+++ b/lib/libzfs/libzfs_import.c
@@ -1086,7 +1086,8 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
(strncmp(name, "vcs", 3) == 0) ||
(strncmp(name, "parport", 7) == 0) ||
(strncmp(name, "lp", 2) == 0) ||
- (strncmp(name, "fd", 2) == 0))
+ (strncmp(name, "fd", 2) == 0) ||
+ (strncmp(name, "hpet", 4) == 0))
continue;
if ((fd = openat64(dfd, name, O_RDONLY)) < 0)