Skip to contentSkip to conversation

Do not skip records with nonblocking connections

PATCH In review Steve Dickson 2 participants 3 messages Jun 5, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Do not skip records with nonblocking connections

With non-blocking connections, do not skip records when receiving the streams since entire value messages can be ignored which in cause the entire stream to become out of sync.

For example, two mounts simultaneously send two unmaps commands. The first one is read, then the second thrown away due to skipping the record. Skipping this record will cause XDR error later in processing of the stream.

---
 src/svc_vc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
src/svc_vc.c +5 -0
index aaaf2d7..15dac18 100644
@@ -610,6 +610,11 @@ svc_vc_recv(xprt, msg)
 	}
 
 	xdrs->x_op = XDR_DECODE;
+	/*
+	 * No need skip records with nonblocking connections
+	 */
+	if (cd->nonblock == FALSE)
+		(void)xdrrec_skiprecord(xdrs);
 	(void)xdrrec_skiprecord(xdrs);
 	if (xdr_callmsg(xdrs, msg)) {
 		cd->x_id = msg->rm_xid;
Signature · 1 line
1.7.4.4
#1 lore raw

Sent from my iPad

Quoted 19 lines · Steve Dickson

With non-blocking connections, do not skip records when receiving the streams since entire value messages can be ignored which in cause the entire stream to become out of sync.

For example, two mounts simultaneously send two unmaps commands. The first one is read, then the second thrown away due to skipping the record. Skipping this record will cause XDR error later in processing of the stream.

---
src/svc_vc.c | 5 +++++

1 files changed, 5 insertions(+), 0 deletions(-)
src/svc_vc.c +0 -0
index aaaf2d7..15dac18 100644

src/svc_vc.c svc_vc_recv(xprt, msg) · line 618

Quoted 9 lines
src/svc_vc.c +5 -0
@@ -610,6 +610,11 @@ svc_vc_recv(xprt, msg)
   }
 
   xdrs->x_op = XDR_DECODE;
+    /*
+     * No need skip records with nonblocking connections
+     */
+    if (cd->nonblock == FALSE)
+        (void)xdrrec_skiprecord(xdrs);
   (void)xdrrec_skiprecord(xdrs);

Do you want to delete the unconditional invocation of xdrrec_skiprecord() here?

Quoted 16 lines
src/svc_vc.c +0 -0
   if (xdr_callmsg(xdrs, msg)) {
       cd->x_id = msg->rm_xid;
Signature · 13 lines
1.7.4.4


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Libtirpc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libtirpc-devel
#2 lore raw
Quoted 27 lines · Chuck Lever

Sent from my iPad

Quoted 21 lines · Steve Dickson

With non-blocking connections, do not skip records when receiving the streams since entire value messages can be ignored which in cause the entire stream to become out of sync.

For example, two mounts simultaneously send two unmaps commands. The first one is read, then the second thrown away due to skipping the record. Skipping this record will cause XDR error later in processing of the stream.

---
src/svc_vc.c | 5 +++++

1 files changed, 5 insertions(+), 0 deletions(-)
src/svc_vc.c +0 -0
index aaaf2d7..15dac18 100644
@@ -610,6 +610,11 @@ svc_vc_recv(xprt, msg)
   }
 
Quoted 9 lines

src/svc_vc.c svc_vc_recv(xprt, msg) · line 618

Quoted 7 lines
src/svc_vc.c +5 -0
   xdrs->x_op = XDR_DECODE;
+    /*
+     * No need skip records with nonblocking connections
+     */
+    if (cd->nonblock == FALSE)
+        (void)xdrrec_skiprecord(xdrs);
   (void)xdrrec_skiprecord(xdrs);

Do you want to delete the unconditional invocation of xdrrec_skiprecord() here?

Yes I do... a small cut/past error... good catch!

steved.

Quoted 17 lines
Quoted 17 lines
src/svc_vc.c +0 -0
   if (xdr_callmsg(xdrs, msg)) {
       cd->x_id = msg->rm_xid;
Signature · 13 lines
1.7.4.4


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Libtirpc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libtirpc-devel