From f36da16d36335f3cde4725763dbb68414cc74c50 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sun, 23 May 2010 09:38:29 -0700 Subject: [PATCH] Skip /dev/watchdog when scanning /dev/ for import. Do not open /dev/watchdog to stat it because it requires a special close or the watchdog with be triggered and the system reset. --- lib/libzfs/libzfs_import.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c index 3b0c813ada..26b313fe3f 100644 --- a/lib/libzfs/libzfs_import.c +++ b/lib/libzfs/libzfs_import.c @@ -943,6 +943,14 @@ zpool_find_import_impl(libzfs_handle_t *hdl, int argc, char **argv, (name[1] == 0 || (name[1] == '.' && name[2] == 0))) continue; + /* + * Do not open /dev/watchdog to stat it because + * it requires a special close or the watchdog + * with be triggered and the system reset. + */ + if (strcmp(name, "watchdog") == 0) + continue; + if ((fd = openat64(dfd, name, O_RDONLY)) < 0) continue;