The nfs_quick_reply() functionality relies on taking a copy of the
authorzoulasc <christos@zoulas.com>
Thu, 3 Mar 2016 18:30:29 +0000 (13:30 -0500)
committerzoulasc <christos@zoulas.com>
Thu, 3 Mar 2016 18:30:29 +0000 (13:30 -0500)
current transport for later use.

The problem with this is the context of the RPC message is kept in
the transport and if any RPC message arrives before nfs_quick_reply()
is called that context will be corrupted.

So add a function get_nfs_xprt() to replace the current transport
with a new one returning the passed in transort so nfs_quick_reply()
can use it later.

A function put_nfs_xprt() is also added (although not really needed
since it just destroys the now unused transport) for completeness.

From: Ian Kent

conf/transp/transp_sockets.c
conf/transp/transp_tli.c

index 98f79c8d21aa0c2ecad6868a56c331188653b38c..42502cc9b2160ebaa452d0200863448eec040fbc 100644 (file)
@@ -299,7 +299,7 @@ get_nfs_xprt(SVCXPRT *nfs_xprt)
   xprt_unregister(nfs_xprt);
   newxprt = svcudp_create(newfd);
   if (!newxprt) {
-    plog(XLOG_FATAL, "Can't swicth to new transpot");
+    plog(XLOG_FATAL, "Can't switch to new transport");
     xprt_register(nfs_xprt);
     close(newfd);
     return NULL;
index ea565cce81437c3dab69e3f903b89dacedb66e63..1c47fd95a56f4d27a041537c99c96adf90250575 100644 (file)
@@ -482,7 +482,7 @@ get_nfs_xprt(SVCXPRT *nfs_xprt)
   xprt_unregister(nfs_xprt);
   newxprt = svc_tli_create(newfd, nfsncp, NULL, 0, 0);
   if (!newxprt) {
-    plog(XLOG_FATAL, "Can't swicth to new transpot");
+    plog(XLOG_FATAL, "Can't switch to new transport");
     xprt_register(nfs_xprt);
     close(newfd);
     return NULL;