aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index d3fe866f57ac..c5347d29cfb7 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -97,8 +97,7 @@ static int
97rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name) 97rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
98{ 98{
99 static uint32_t clntid; 99 static uint32_t clntid;
100 struct nameidata nd; 100 struct path path, dir;
101 struct path path;
102 char name[15]; 101 char name[15];
103 struct qstr q = { 102 struct qstr q = {
104 .name = name, 103 .name = name,
@@ -113,7 +112,7 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
113 path.mnt = rpc_get_mount(); 112 path.mnt = rpc_get_mount();
114 if (IS_ERR(path.mnt)) 113 if (IS_ERR(path.mnt))
115 return PTR_ERR(path.mnt); 114 return PTR_ERR(path.mnt);
116 error = vfs_path_lookup(path.mnt->mnt_root, path.mnt, dir_name, 0, &nd); 115 error = vfs_path_lookup(path.mnt->mnt_root, path.mnt, dir_name, 0, &dir);
117 if (error) 116 if (error)
118 goto err; 117 goto err;
119 118
@@ -121,7 +120,7 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
121 q.len = snprintf(name, sizeof(name), "clnt%x", (unsigned int)clntid++); 120 q.len = snprintf(name, sizeof(name), "clnt%x", (unsigned int)clntid++);
122 name[sizeof(name) - 1] = '\0'; 121 name[sizeof(name) - 1] = '\0';
123 q.hash = full_name_hash(q.name, q.len); 122 q.hash = full_name_hash(q.name, q.len);
124 path.dentry = rpc_create_client_dir(nd.path.dentry, &q, clnt); 123 path.dentry = rpc_create_client_dir(dir.dentry, &q, clnt);
125 if (!IS_ERR(path.dentry)) 124 if (!IS_ERR(path.dentry))
126 break; 125 break;
127 error = PTR_ERR(path.dentry); 126 error = PTR_ERR(path.dentry);
@@ -132,11 +131,11 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
132 goto err_path_put; 131 goto err_path_put;
133 } 132 }
134 } 133 }
135 path_put(&nd.path); 134 path_put(&dir);
136 clnt->cl_path = path; 135 clnt->cl_path = path;
137 return 0; 136 return 0;
138err_path_put: 137err_path_put:
139 path_put(&nd.path); 138 path_put(&dir);
140err: 139err:
141 rpc_put_mount(); 140 rpc_put_mount();
142 return error; 141 return error;
@@ -1665,19 +1664,18 @@ rpc_verify_header(struct rpc_task *task)
1665 if (--len < 0) 1664 if (--len < 0)
1666 goto out_overflow; 1665 goto out_overflow;
1667 switch ((n = ntohl(*p++))) { 1666 switch ((n = ntohl(*p++))) {
1668 case RPC_AUTH_ERROR: 1667 case RPC_AUTH_ERROR:
1669 break; 1668 break;
1670 case RPC_MISMATCH: 1669 case RPC_MISMATCH:
1671 dprintk("RPC: %5u %s: RPC call version " 1670 dprintk("RPC: %5u %s: RPC call version mismatch!\n",
1672 "mismatch!\n", 1671 task->tk_pid, __func__);
1673 task->tk_pid, __func__); 1672 error = -EPROTONOSUPPORT;
1674 error = -EPROTONOSUPPORT; 1673 goto out_err;
1675 goto out_err; 1674 default:
1676 default: 1675 dprintk("RPC: %5u %s: RPC call rejected, "
1677 dprintk("RPC: %5u %s: RPC call rejected, " 1676 "unknown error: %x\n",
1678 "unknown error: %x\n", 1677 task->tk_pid, __func__, n);
1679 task->tk_pid, __func__, n); 1678 goto out_eio;
1680 goto out_eio;
1681 } 1679 }
1682 if (--len < 0) 1680 if (--len < 0)
1683 goto out_overflow; 1681 goto out_overflow;