diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-15 11:51:21 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-04 14:43:38 -0500 |
commit | 7fc388460e8479c5b3120cb2fcf0e0daec70b93f (patch) | |
tree | eb6445ae11e33658f1c96456e34f0b811d2d83d4 /fs/nfs/nfs2xdr.c | |
parent | 1fea73a86527d7ec463af6ff04b0830e1425ff6c (diff) |
NFS: Remove asserts from the NFS XDR code
Convert the ones that are not trivial to check into WARN_ON_ONCE().
Remove checks for things such as NFS2_MAXPATHLEN, which are trivially
done by the caller.
Add a comment to the case of nfs3_xdr_enc_setacl3args. What is being
done there is just wrong...
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs2xdr.c')
-rw-r--r-- | fs/nfs/nfs2xdr.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index d04f0df7be55..06b9df49f7f7 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
@@ -195,7 +195,6 @@ static void encode_fhandle(struct xdr_stream *xdr, const struct nfs_fh *fh) | |||
195 | { | 195 | { |
196 | __be32 *p; | 196 | __be32 *p; |
197 | 197 | ||
198 | BUG_ON(fh->size != NFS2_FHSIZE); | ||
199 | p = xdr_reserve_space(xdr, NFS2_FHSIZE); | 198 | p = xdr_reserve_space(xdr, NFS2_FHSIZE); |
200 | memcpy(p, fh->data, NFS2_FHSIZE); | 199 | memcpy(p, fh->data, NFS2_FHSIZE); |
201 | } | 200 | } |
@@ -388,7 +387,7 @@ static void encode_filename(struct xdr_stream *xdr, | |||
388 | { | 387 | { |
389 | __be32 *p; | 388 | __be32 *p; |
390 | 389 | ||
391 | BUG_ON(length > NFS2_MAXNAMLEN); | 390 | WARN_ON_ONCE(length > NFS2_MAXNAMLEN); |
392 | p = xdr_reserve_space(xdr, 4 + length); | 391 | p = xdr_reserve_space(xdr, 4 + length); |
393 | xdr_encode_opaque(p, name, length); | 392 | xdr_encode_opaque(p, name, length); |
394 | } | 393 | } |
@@ -428,7 +427,6 @@ static void encode_path(struct xdr_stream *xdr, struct page **pages, u32 length) | |||
428 | { | 427 | { |
429 | __be32 *p; | 428 | __be32 *p; |
430 | 429 | ||
431 | BUG_ON(length > NFS2_MAXPATHLEN); | ||
432 | p = xdr_reserve_space(xdr, 4); | 430 | p = xdr_reserve_space(xdr, 4); |
433 | *p = cpu_to_be32(length); | 431 | *p = cpu_to_be32(length); |
434 | xdr_write_pages(xdr, pages, 0, length); | 432 | xdr_write_pages(xdr, pages, 0, length); |