diff mbox

[v5,3/4] rsockets: fix rsocket state when interrupted waiting for events

Message ID 3429fa019ebfb4a49bf1e670da8ae4fe@imap.linux.ibm.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Sreedhar Kodali Sept. 18, 2014, 10:45 a.m. UTC
Note: This patch is reworked based on suggestions from Sean and Jason
       Also attached the patch file for convenience

 From: 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>
     ---
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;
 	}

Comments

Hefty, Sean Sept. 25, 2014, 10:59 p.m. UTC | #1
Thanks - applied
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
         }