提交 4a70316c 编写于 作者: K Kinglong Mee 提交者: Trond Myklebust

nfs: Fix truncated client owner id without proto type

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: a3192688 ("nfs: make nfs4_init_nonuniform_client_string use a dynamically allocated buffer")
Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 889d94d4
...@@ -5020,7 +5020,7 @@ nfs4_init_nonuniform_client_string(struct nfs_client *clp) ...@@ -5020,7 +5020,7 @@ nfs4_init_nonuniform_client_string(struct nfs_client *clp)
return 0; return 0;
retry: retry:
rcu_read_lock(); 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)) + strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)) +
1 + 1 +
strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO)) + strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO)) +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册