You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
diff -Naur ceph-10.2.3-orig/src/krbd.cc ceph-10.2.3/src/krbd.cc
|
|
--- ceph-10.2.3-orig/src/krbd.cc 2016-09-21 15:48:55.000000000 +0000
|
|
+++ ceph-10.2.3/src/krbd.cc 2019-04-29 16:24:41.136578239 +0000
|
|
@@ -40,6 +40,8 @@
|
|
#include <blkid/blkid.h>
|
|
#include <libudev.h>
|
|
|
|
+const static int POLL_TIMEOUT=120000;
|
|
+
|
|
using namespace std;
|
|
|
|
struct krbd_ctx {
|
|
@@ -184,12 +186,17 @@
|
|
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, -1) < 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;
|
|
@@ -458,12 +465,17 @@
|
|
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, -1) < 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;
|