summaryrefslogtreecommitdiffstats
path: root/src/krbd.cc
diff options
context:
space:
mode:
authorJason Dillaman <dillaman@redhat.com>2017-05-05 20:40:55 +0200
committerGitHub <noreply@github.com>2017-05-05 20:40:55 +0200
commit128f593fe89e4a901d71260da4c777f8b0eec332 (patch)
tree78e3f88ea1722718b486ad3d05489f59ca66c238 /src/krbd.cc
parentMerge pull request #14834 from runsisi/wip-fix-double-free (diff)
parentrbd: stop indefinite thread waiting in krbd.cc (diff)
downloadceph-128f593fe89e4a901d71260da4c777f8b0eec332.tar.xz
ceph-128f593fe89e4a901d71260da4c777f8b0eec332.zip
Merge pull request #14051 from SpandanKumarSahu/bug#17195
rbd: stop indefinite thread waiting in krbd udev handling Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Diffstat (limited to 'src/krbd.cc')
-rw-r--r--src/krbd.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/krbd.cc b/src/krbd.cc
index fe0d8c2b285..bf7e2558369 100644
--- a/src/krbd.cc
+++ b/src/krbd.cc
@@ -42,6 +42,8 @@
using namespace std;
+const static int POLL_TIMEOUT=120000;
+
struct krbd_ctx {
CephContext *cct;
struct udev *udev;
@@ -189,7 +191,7 @@ static int wait_for_udev_add(struct udev_monitor *mon, const char *pool,
fds[0].fd = udev_monitor_get_fd(mon);
fds[0].events = POLLIN;
- if (poll(fds, 1, -1) < 0)
+ if (poll(fds, 1, POLL_TIMEOUT) < 0)
return -errno;
dev = udev_monitor_receive_device(mon);
@@ -473,7 +475,7 @@ static int wait_for_udev_remove(struct udev_monitor *mon, dev_t devno)
fds[0].fd = udev_monitor_get_fd(mon);
fds[0].events = POLLIN;
- if (poll(fds, 1, -1) < 0)
+ if (poll(fds, 1, POLL_TIMEOUT) < 0)
return -errno;
dev = udev_monitor_receive_device(mon);