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:
parent
4b4015258d
commit
e19dec32a7
|
@ -948,11 +948,10 @@ zpool_find_import_impl(libzfs_handle_t *hdl, int argc, char **argv,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ignore failed stats. We only want regular
|
* Ignore failed stats. We only want regular
|
||||||
* files, character devs and block devs.
|
* files and block devs.
|
||||||
*/
|
*/
|
||||||
if (fstat64(fd, &statbuf) != 0 ||
|
if (fstat64(fd, &statbuf) != 0 ||
|
||||||
(!S_ISREG(statbuf.st_mode) &&
|
(!S_ISREG(statbuf.st_mode) &&
|
||||||
!S_ISCHR(statbuf.st_mode) &&
|
|
||||||
!S_ISBLK(statbuf.st_mode))) {
|
!S_ISBLK(statbuf.st_mode))) {
|
||||||
(void) close(fd);
|
(void) close(fd);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue