NFSv4.1: Set the RPC_CLNT_CREATE_INFINITE_SLOTS flag for NFSv4.1 transports
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 14 Apr 2013 15:49:51 +0000 (11:49 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 14 Apr 2013 16:59:28 +0000 (12:59 -0400)
This ensures that the RPC layer doesn't override the NFS session
negotiation.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/client.c
fs/nfs/nfs4client.c
include/linux/nfs_fs_sb.h

index 84d8eae203a7985ba7a78d54849e8e87782e44f8..c513b0cc835f9f32db99def2a6868fdf7848e5fe 100644 (file)
@@ -593,6 +593,8 @@ int nfs_create_rpc_client(struct nfs_client *clp,
                args.flags |= RPC_CLNT_CREATE_DISCRTRY;
        if (test_bit(NFS_CS_NORESVPORT, &clp->cl_flags))
                args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
+       if (test_bit(NFS_CS_INFINITE_SLOTS, &clp->cl_flags))
+               args.flags |= RPC_CLNT_CREATE_INFINITE_SLOTS;
 
        if (!IS_ERR(clp->cl_rpcclient))
                return 0;
index 17b34b2da2df62fd15d7ebda761e8ade3d964af2..f4d4d4ec6bf76e83ff0708279cd7f420de4091d9 100644 (file)
@@ -198,6 +198,8 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
        /* Check NFS protocol revision and initialize RPC op vector */
        clp->rpc_ops = &nfs_v4_clientops;
 
+       if (clp->cl_minorversion != 0)
+               __set_bit(NFS_CS_INFINITE_SLOTS, &clp->cl_flags);
        __set_bit(NFS_CS_DISCRTRY, &clp->cl_flags);
        error = nfs_create_rpc_client(clp, timeparms, authflavour);
        if (error < 0)
index d8fdfdc7a8fe142b9244593491009c94b676cbaf..3b7fa2abecca690e0d007a4aa97fded3e1a1bad3 100644 (file)
@@ -40,6 +40,7 @@ struct nfs_client {
 #define NFS_CS_NORESVPORT      0               /* - use ephemeral src port */
 #define NFS_CS_DISCRTRY                1               /* - disconnect on RPC retry */
 #define NFS_CS_MIGRATION       2               /* - transparent state migr */
+#define NFS_CS_INFINITE_SLOTS  3               /* - don't limit TCP slots */
        struct sockaddr_storage cl_addr;        /* server identifier */
        size_t                  cl_addrlen;
        char *                  cl_hostname;    /* hostname of server */