aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 40836ee5dc3a..672d9b0ef2c5 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -936,7 +936,7 @@ static void encode_compound_hdr(struct xdr_stream *xdr,
936 * but this is not required as a MUST for the server to do so. */ 936 * but this is not required as a MUST for the server to do so. */
937 hdr->replen = RPC_REPHDRSIZE + auth->au_rslack + 3 + hdr->taglen; 937 hdr->replen = RPC_REPHDRSIZE + auth->au_rslack + 3 + hdr->taglen;
938 938
939 BUG_ON(hdr->taglen > NFS4_MAXTAGLEN); 939 WARN_ON_ONCE(hdr->taglen > NFS4_MAXTAGLEN);
940 encode_string(xdr, hdr->taglen, hdr->tag); 940 encode_string(xdr, hdr->taglen, hdr->tag);
941 p = reserve_space(xdr, 8); 941 p = reserve_space(xdr, 8);
942 *p++ = cpu_to_be32(hdr->minorversion); 942 *p++ = cpu_to_be32(hdr->minorversion);
@@ -955,7 +955,7 @@ static void encode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 op,
955 955
956static void encode_nops(struct compound_hdr *hdr) 956static void encode_nops(struct compound_hdr *hdr)
957{ 957{
958 BUG_ON(hdr->nops > NFS4_MAX_OPS); 958 WARN_ON_ONCE(hdr->nops > NFS4_MAX_OPS);
959 *hdr->nops_p = htonl(hdr->nops); 959 *hdr->nops_p = htonl(hdr->nops);
960} 960}
961 961
@@ -1403,7 +1403,6 @@ static void encode_opentype(struct xdr_stream *xdr, const struct nfs_openargs *a
1403 *p = cpu_to_be32(NFS4_OPEN_NOCREATE); 1403 *p = cpu_to_be32(NFS4_OPEN_NOCREATE);
1404 break; 1404 break;
1405 default: 1405 default:
1406 BUG_ON(arg->claim != NFS4_OPEN_CLAIM_NULL);
1407 *p = cpu_to_be32(NFS4_OPEN_CREATE); 1406 *p = cpu_to_be32(NFS4_OPEN_CREATE);
1408 encode_createmode(xdr, arg); 1407 encode_createmode(xdr, arg);
1409 } 1408 }
@@ -1621,7 +1620,6 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg, struct compoun
1621 p = reserve_space(xdr, 2*4); 1620 p = reserve_space(xdr, 2*4);
1622 *p++ = cpu_to_be32(1); 1621 *p++ = cpu_to_be32(1);
1623 *p = cpu_to_be32(FATTR4_WORD0_ACL); 1622 *p = cpu_to_be32(FATTR4_WORD0_ACL);
1624 BUG_ON(arg->acl_len % 4);
1625 p = reserve_space(xdr, 4); 1623 p = reserve_space(xdr, 4);
1626 *p = cpu_to_be32(arg->acl_len); 1624 *p = cpu_to_be32(arg->acl_len);
1627 xdr_write_pages(xdr, arg->acl_pages, arg->acl_pgbase, arg->acl_len); 1625 xdr_write_pages(xdr, arg->acl_pages, arg->acl_pgbase, arg->acl_len);