* [PATCH v5 3/4] rsockets: fix rsocket state when interrupted waiting for events
@ 2014-09-18 10:45 Sreedhar Kodali
[not found] ` <3429fa019ebfb4a49bf1e670da8ae4fe-FJGp5E75HVmZamtmwQBW5tBPR1lH4CV8@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Sreedhar Kodali @ 2014-09-18 10:45 UTC (permalink / raw)
To: sean.hefty-ral2JQCrhuEAvxtiuMwx3w
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
pradeeps-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]
Note: This patch is reworked based on suggestions from Sean and Jason
Also attached the patch file for convenience
From: Sreedhar Kodali <srkodali-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Date: Thu Sep 18 14:35:42 2014 +0530
While waiting for a completion event, rsocket state is incorrectly
set to error when interrupted. Instead, the caller of get
completion event should decide what to do with it based on
errno. The fix is do not change the state to rs_error when
errno is EINTR inside get completion event.
Signed-off-by: Sreedhar Kodali <srkodali-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Reviewed-by: Pradeep Satyanarayana <pradeeps-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
diff --git a/src/rsocket.c b/src/rsocket.c
index 39c35cf..16792cf 100644
--- a/src/rsocket.c
+++ b/src/rsocket.c
@@ -1976,7 +1976,7 @@ static int rs_get_cq_event(struct rsocket *rs)
rs->unack_cqe = 0;
}
rs->cq_armed = 0;
- } else if (errno != EAGAIN) {
+ } else if (!(errno == EAGAIN || errno == EINTR)) {
rs->state = rs_error;
}
[-- Attachment #2: librdmacm_src_rsocket_fix_state_20140918.patch3 --]
[-- Type: text/plain, Size: 946 bytes --]
commit 3cd51b727b58f2e3aa03d77e9c410a5488a09112
Author: Sreedhar Kodali <srkodali@linux.vnet.ibm.com>
Date: Thu Sep 18 14:35:42 2014 +0530
While waiting for a completion event, rsocket state is incorrectly
set to error when interrupted. Instead, the caller of get
completion event should decide what to do with it based on
errno. The fix is do not change the state to rs_error when
errno is EINTR inside get completion event.
Signed-off-by: Sreedhar Kodali <srkodali@linux.vnet.ibm.com>
Reviewed-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
---
diff --git a/src/rsocket.c b/src/rsocket.c
index 39c35cf..16792cf 100644
--- a/src/rsocket.c
+++ b/src/rsocket.c
@@ -1976,7 +1976,7 @@ static int rs_get_cq_event(struct rsocket *rs)
rs->unack_cqe = 0;
}
rs->cq_armed = 0;
- } else if (errno != EAGAIN) {
+ } else if (!(errno == EAGAIN || errno == EINTR)) {
rs->state = rs_error;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH v5 3/4] rsockets: fix rsocket state when interrupted waiting for events
[not found] ` <3429fa019ebfb4a49bf1e670da8ae4fe-FJGp5E75HVmZamtmwQBW5tBPR1lH4CV8@public.gmane.org>
@ 2014-09-25 22:59 ` Hefty, Sean
0 siblings, 0 replies; 2+ messages in thread
From: Hefty, Sean @ 2014-09-25 22:59 UTC (permalink / raw)
To: Sreedhar Kodali
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
pradeeps-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
Thanks - applied
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-25 22:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-18 10:45 [PATCH v5 3/4] rsockets: fix rsocket state when interrupted waiting for events Sreedhar Kodali
[not found] ` <3429fa019ebfb4a49bf1e670da8ae4fe-FJGp5E75HVmZamtmwQBW5tBPR1lH4CV8@public.gmane.org>
2014-09-25 22:59 ` Hefty, Sean
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.