From e19dec32a72644fcb2fc7c5327b2ad212a3aa10a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 18 May 2010 16:13:10 -0700 Subject: [PATCH] Minor fix from linux-legacy branch. Fold in a minor fix from the removed linux-legacy branch to skip checking character devices in /dev/ during import. Under Linux pread() may simply block when reading from these devices causing the import to hang. --- lib/libzfs/libzfs_import.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c index fa5aca0d8c..3b0c813ada 100644 --- a/lib/libzfs/libzfs_import.c +++ b/lib/libzfs/libzfs_import.c @@ -948,11 +948,10 @@ zpool_find_import_impl(libzfs_handle_t *hdl, int argc, char **argv, /* * Ignore failed stats. We only want regular - * files, character devs and block devs. + * files and block devs. */ if (fstat64(fd, &statbuf) != 0 || (!S_ISREG(statbuf.st_mode) && - !S_ISCHR(statbuf.st_mode) && !S_ISBLK(statbuf.st_mode))) { (void) close(fd); continue;