diff options
author | Jason Dillaman <dillaman@redhat.com> | 2017-05-05 20:40:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-05 20:40:55 +0200 |
commit | 128f593fe89e4a901d71260da4c777f8b0eec332 (patch) | |
tree | 78e3f88ea1722718b486ad3d05489f59ca66c238 /src/krbd.cc | |
parent | Merge pull request #14834 from runsisi/wip-fix-double-free (diff) | |
parent | rbd: stop indefinite thread waiting in krbd.cc (diff) | |
download | ceph-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.cc | 6 |
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); |