diff options
Diffstat (limited to 'fs/nfs/mount_clnt.c')
| -rw-r--r-- | fs/nfs/mount_clnt.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c index 8e65c7f1f87c..91a6faf811ac 100644 --- a/fs/nfs/mount_clnt.c +++ b/fs/nfs/mount_clnt.c | |||
| @@ -169,6 +169,9 @@ int nfs_mount(struct nfs_mount_request *info) | |||
| 169 | (info->hostname ? info->hostname : "server"), | 169 | (info->hostname ? info->hostname : "server"), |
| 170 | info->dirpath); | 170 | info->dirpath); |
| 171 | 171 | ||
| 172 | if (strlen(info->dirpath) > MNTPATHLEN) | ||
| 173 | return -ENAMETOOLONG; | ||
| 174 | |||
| 172 | if (info->noresvport) | 175 | if (info->noresvport) |
| 173 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; | 176 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; |
| 174 | 177 | ||
| @@ -181,7 +184,7 @@ int nfs_mount(struct nfs_mount_request *info) | |||
| 181 | else | 184 | else |
| 182 | msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC_MNT]; | 185 | msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC_MNT]; |
| 183 | 186 | ||
| 184 | status = rpc_call_sync(mnt_clnt, &msg, 0); | 187 | status = rpc_call_sync(mnt_clnt, &msg, RPC_TASK_SOFT|RPC_TASK_TIMEOUT); |
| 185 | rpc_shutdown_client(mnt_clnt); | 188 | rpc_shutdown_client(mnt_clnt); |
| 186 | 189 | ||
| 187 | if (status < 0) | 190 | if (status < 0) |
| @@ -242,6 +245,9 @@ void nfs_umount(const struct nfs_mount_request *info) | |||
| 242 | struct rpc_clnt *clnt; | 245 | struct rpc_clnt *clnt; |
| 243 | int status; | 246 | int status; |
| 244 | 247 | ||
| 248 | if (strlen(info->dirpath) > MNTPATHLEN) | ||
| 249 | return; | ||
| 250 | |||
| 245 | if (info->noresvport) | 251 | if (info->noresvport) |
| 246 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; | 252 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; |
| 247 | 253 | ||
| @@ -283,7 +289,6 @@ static void encode_mntdirpath(struct xdr_stream *xdr, const char *pathname) | |||
| 283 | const u32 pathname_len = strlen(pathname); | 289 | const u32 pathname_len = strlen(pathname); |
| 284 | __be32 *p; | 290 | __be32 *p; |
| 285 | 291 | ||
| 286 | BUG_ON(pathname_len > MNTPATHLEN); | ||
| 287 | p = xdr_reserve_space(xdr, 4 + pathname_len); | 292 | p = xdr_reserve_space(xdr, 4 + pathname_len); |
| 288 | xdr_encode_opaque(p, pathname, pathname_len); | 293 | xdr_encode_opaque(p, pathname, pathname_len); |
| 289 | } | 294 | } |
