Skip to contentSkip to conversation

rsockets: fix rsocket state when interrupted waiting for events

PATCH Superseded Sreedhar Kodali 2 participants 2 messages Sep 18, 2014 – Sep 25, 2014 1 message not in the archive InfiniBand

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 3/4 rsockets: fix rsocket state when interrupted waiting for events

Note: This patch is reworked based on suggestions from Sean and Jason
Also attached the patch file for convenience

From: Sreedhar Kodali <[email protected]>
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.

---

src/rsocket.c +1 -1
index 39c35cf..16792cf 100644
@@ -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;
        }

commit 3cd51b727b58f2e3aa03d77e9c410a5488a09112

Author: Sreedhar Kodali <[email protected]>
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.

---

src/rsocket.c +1 -1
index 39c35cf..16792cf 100644
@@ -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;
 	}
 

A message that is not in the archive (sent off-list or not yet received): 3429fa019ebfb4a49bf1e670da8ae4fe-FJGp5E75HVmZamtmwQBW5tBPR1lH4CV8@public.gmane.org