Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic: rbd: krbd: return -ETIMEDOUT in polling #27588

Merged
merged 1 commit into from May 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/krbd.cc
Expand Up @@ -193,12 +193,17 @@ static int wait_for_udev_add(struct udev_monitor *mon, const char *pool,
for (;;) {
struct pollfd fds[1];
struct udev_device *dev;
int r;

fds[0].fd = udev_monitor_get_fd(mon);
fds[0].events = POLLIN;
if (poll(fds, 1, POLL_TIMEOUT) < 0)
r = poll(fds, 1, POLL_TIMEOUT);
if (r < 0)
return -errno;

if (r == 0)
return -ETIMEDOUT;

dev = udev_monitor_receive_device(mon);
if (!dev)
continue;
Expand Down Expand Up @@ -489,12 +494,17 @@ static int wait_for_udev_remove(struct udev_monitor *mon, dev_t devno)
for (;;) {
struct pollfd fds[1];
struct udev_device *dev;
int r;

fds[0].fd = udev_monitor_get_fd(mon);
fds[0].events = POLLIN;
if (poll(fds, 1, POLL_TIMEOUT) < 0)
r = poll(fds, 1, POLL_TIMEOUT);
if (r < 0)
return -errno;

if (r == 0)
return -ETIMEDOUT;

dev = udev_monitor_receive_device(mon);
if (!dev)
continue;
Expand Down