DORMANTno replies

[PATCH 1/4] librdamcm/rsocket: Handle SHUT_RD/WR shutdown flags

From: Hefty, Sean <hidden>
Date: 2012-06-06 18:42:10
Subsystem: the rest · Maintainer: Linus Torvalds

Sridhar Samudrala [off-list ref] reported an error (EOPNOTSUPP)
after calling select().

The issue is that rshutdown(SHUT_WR) was called before select().
As part of shutdown, rsockets switches the underlying fd from
nonblocking to blocking to ensure that previously sent data has
completed.  shutdown(SHUT_WR) indicates that the socket should be
kept open for receiving data.

Delay handling the actual shutdown unless SHUT_RDWR is specified,
or the socket is closed.

Signed-off-by: Sean Hefty <redacted>
---
 src/rsocket.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/rsocket.c b/src/rsocket.c
index c111797..8f20b4a 100644
--- a/src/rsocket.c
+++ b/src/rsocket.c
@@ -1592,6 +1592,9 @@ int rshutdown(int socket, int how)
 	struct rsocket *rs;
 	int ret = 0;
 
+	if (how != SHUT_RDWR)
+		return 0;
+
 	rs = idm_at(&idm, socket);
 	if (rs->fd_flags & O_NONBLOCK)
 		rs_set_nonblocking(rs, 0);


--
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help