]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nfs: Fix truncated client owner id without proto type
authorKinglong Mee <kinglongmee@gmail.com>
Mon, 31 Aug 2015 02:53:33 +0000 (10:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:33:30 +0000 (19:33 +0200)
commit 4a70316caef7d158445e672e146eb9f1b8c1aeee upstream.

The length of "Linux NFSv4.0 " is 14, not 10.

Without this patch, I get a truncated client owner id as,
"Linux NFSv4.0 ::1/::1"

With this patch,
"Linux NFSv4.0 ::1/::1 tcp"

Fixes: a319268891 ("nfs: make nfs4_init_nonuniform_client_string use a dynamically allocated buffer")
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c

index 144192f5df67f4b36b2db5908e4eea639f94d178..6d134e8c2f0d51c620b20132be1e9752864523e7 100644 (file)
@@ -4989,7 +4989,7 @@ nfs4_init_nonuniform_client_string(struct nfs_client *clp)
                return 0;
 retry:
        rcu_read_lock();
-       len = 10 + strlen(clp->cl_ipaddr) + 1 +
+       len = 14 + strlen(clp->cl_ipaddr) + 1 +
                strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)) +
                1 +
                strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO)) +