- There is really no ti-rpc nfsv4, so don't send one; instead send a v3 for now.
authorzoulasc <christos@zoulas.com>
Thu, 10 Mar 2016 22:50:34 +0000 (17:50 -0500)
committerzoulasc <christos@zoulas.com>
Thu, 10 Mar 2016 22:50:34 +0000 (17:50 -0500)
amd/srvr_nfs.c

index b7c852c9e1de5a36570b69965e47a654c5fb4634..1418a1a85ea47ae57864b90e8d7aebbfaae3b6ac 100644 (file)
@@ -140,6 +140,7 @@ create_ping_payload(u_long nfs_version)
 {
   XDR ping_xdr;
   struct rpc_msg ping_msg;
+  int rpc_version;
 
   /*
    * Non nfs mounts like /afs/glue.umd.edu have ended up here.
@@ -150,7 +151,17 @@ create_ping_payload(u_long nfs_version)
   } else
     plog(XLOG_INFO, "%s: nfs_version: %d", __func__, (int) nfs_version);
 
-  rpc_msg_init(&ping_msg, NFS_PROGRAM, nfs_version, NFSPROC_NULL);
+  /*
+   * There is really no ti-rpc version for NFSv4; most servers respond
+   * with "program unavailable", which is ok since we don't check the
+   * payload, we just care about the pings. Some servers though are
+   * antisocial (Isilon) and don't respond (which is their right to do).
+   * Eventually we should make a new mechanism to do server pings for
+   * NFSv4, but for now it is easiest to downgrade the RPC version to 3.
+   */
+  rpc_version = nfs_version == 4 ? 3 : nfs_version;
+
+  rpc_msg_init(&ping_msg, NFS_PROGRAM, rpc_version, NFSPROC_NULL);
 
   /*
    * Create an XDR endpoint
@@ -600,6 +611,7 @@ nfs_keepalive(voidp v)
   case ENETUNREACH:
   case EHOSTDOWN:
   case EHOSTUNREACH:
+    dlog("Failed to NFS ping to %s (%d)", fs->fs_host, error);
     np->np_ping = MAX_ALLOWED_PINGS;   /* immediately down */
     np->np_ttl = (time_t) 0;
     /*