linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* librdmacm infinite loop in rpoll when timeout > 0
@ 2025-09-20  8:33 Ilya Andronov
  2025-09-21 12:17 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Andronov @ 2025-09-20  8:33 UTC (permalink / raw)
  To: linux-rdma

index 005bd0be8..32fb30aea 100644
--- a/librdmacm/rsocket.c
+++ b/librdmacm/rsocket.c
@@ -3362,9 +3362,6 @@ int rpoll(struct pollfd *fds, nfds_t nfds, int timeout)
                if (ret)
                        break;

-               if (rs_poll_enter())
-                       continue;
-
                if (timeout >= 0) {
                        timeout -= (int) ((rs_time_us() - start_time) / 1000);
                        if (timeout <= 0)
@@ -3374,6 +3371,9 @@ int rpoll(struct pollfd *fds, nfds_t nfds, int timeout)
                        pollsleep = wake_up_interval;
                }

+               if (rs_poll_enter())
+                       continue;
+
                ret = poll(rfds, nfds + 1, pollsleep);
                if (ret < 0) {
                        rs_poll_exit();

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-21 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-20  8:33 librdmacm infinite loop in rpoll when timeout > 0 Ilya Andronov
2025-09-21 12:17 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).