diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-15 16:25:42 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-04 14:43:39 -0500 |
commit | 28d79ea33f52cae1ea04808e1ec52b8657b5d804 (patch) | |
tree | 7091086c78383ea3873ea68ace9bd0e6c0e37dfa /fs/nfs/mount_clnt.c | |
parent | f48407ddd46bd215a7b4e1af3940e759a93640c5 (diff) |
NFS: Remove the BUG_ON() in the mount code
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/mount_clnt.c')
-rw-r--r-- | fs/nfs/mount_clnt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c index 015f71f8f62c..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 | ||
@@ -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 | } |