This commit is contained in:
Richard Yao 2024-09-09 17:50:22 -07:00 committed by GitHub
commit a74e207333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -589,6 +589,7 @@ zpool_label_disk_wait(const char *path, int timeout_ms)
int settle_ms = 50; int settle_ms = 50;
long sleep_ms = 10; long sleep_ms = 10;
hrtime_t start, settle; hrtime_t start, settle;
boolean_t c = B_TRUE;
if ((udev = udev_new()) == NULL) if ((udev = udev_new()) == NULL)
return (ENXIO); return (ENXIO);
@ -642,7 +643,11 @@ zpool_label_disk_wait(const char *path, int timeout_ms)
udev_device_unref(dev); udev_device_unref(dev);
(void) usleep(sleep_ms * MILLISEC); (void) usleep(sleep_ms * MILLISEC);
} while (NSEC2MSEC(gethrtime() - start) < timeout_ms); } while ((c = (NSEC2MSEC(gethrtime() - start) < timeout_ms)));
if (c == B_FALSE)
fprintf(stderr, "error: %s",
"ZPOOL_IMPORT_UDEV_TIMEOUT_MS exceeded\n");
udev_unref(udev); udev_unref(udev);