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.
This commit is contained in:
Brian Behlendorf 2010-05-18 16:13:10 -07:00
parent 4b4015258d
commit e19dec32a7
1 changed files with 1 additions and 2 deletions

View File

@ -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;