diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-09-11 18:01:10 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 17:17:09 -0400 |
commit | fe82a183ca3c9188945c4ebeebc2ca45abfa24e5 (patch) | |
tree | 414f292cf5e9808359796af5d6b7c900a0aaefab /fs/nfs/nfs4xdr.c | |
parent | 0ac83779fa5bffb90e32a97abc61f1840af31ee9 (diff) |
NFS: Convert printk's to dprintk's in fs/nfs/nfs?xdr.c
Due to recent edict to replace or remove printk's that can be triggered en
masse by remote misbehavior. Left a few that only occur just before a BUG.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index badd73b7ca12..4dbbf44727ea 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -562,7 +562,6 @@ struct compound_hdr { | |||
562 | 562 | ||
563 | #define RESERVE_SPACE(nbytes) do { \ | 563 | #define RESERVE_SPACE(nbytes) do { \ |
564 | p = xdr_reserve_space(xdr, nbytes); \ | 564 | p = xdr_reserve_space(xdr, nbytes); \ |
565 | if (!p) printk("RESERVE_SPACE(%d) failed in function %s\n", (int) (nbytes), __FUNCTION__); \ | ||
566 | BUG_ON(!p); \ | 565 | BUG_ON(!p); \ |
567 | } while (0) | 566 | } while (0) |
568 | 567 | ||
@@ -628,8 +627,8 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s | |||
628 | if (iap->ia_valid & ATTR_UID) { | 627 | if (iap->ia_valid & ATTR_UID) { |
629 | owner_namelen = nfs_map_uid_to_name(server->nfs_client, iap->ia_uid, owner_name); | 628 | owner_namelen = nfs_map_uid_to_name(server->nfs_client, iap->ia_uid, owner_name); |
630 | if (owner_namelen < 0) { | 629 | if (owner_namelen < 0) { |
631 | printk(KERN_WARNING "nfs: couldn't resolve uid %d to string\n", | 630 | dprintk("nfs: couldn't resolve uid %d to string\n", |
632 | iap->ia_uid); | 631 | iap->ia_uid); |
633 | /* XXX */ | 632 | /* XXX */ |
634 | strcpy(owner_name, "nobody"); | 633 | strcpy(owner_name, "nobody"); |
635 | owner_namelen = sizeof("nobody") - 1; | 634 | owner_namelen = sizeof("nobody") - 1; |
@@ -640,8 +639,8 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s | |||
640 | if (iap->ia_valid & ATTR_GID) { | 639 | if (iap->ia_valid & ATTR_GID) { |
641 | owner_grouplen = nfs_map_gid_to_group(server->nfs_client, iap->ia_gid, owner_group); | 640 | owner_grouplen = nfs_map_gid_to_group(server->nfs_client, iap->ia_gid, owner_group); |
642 | if (owner_grouplen < 0) { | 641 | if (owner_grouplen < 0) { |
643 | printk(KERN_WARNING "nfs4: couldn't resolve gid %d to string\n", | 642 | dprintk("nfs: couldn't resolve gid %d to string\n", |
644 | iap->ia_gid); | 643 | iap->ia_gid); |
645 | strcpy(owner_group, "nobody"); | 644 | strcpy(owner_group, "nobody"); |
646 | owner_grouplen = sizeof("nobody") - 1; | 645 | owner_grouplen = sizeof("nobody") - 1; |
647 | /* goto out; */ | 646 | /* goto out; */ |
@@ -711,7 +710,7 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s | |||
711 | * Now we backfill the bitmap and the attribute buffer length. | 710 | * Now we backfill the bitmap and the attribute buffer length. |
712 | */ | 711 | */ |
713 | if (len != ((char *)p - (char *)q) + 4) { | 712 | if (len != ((char *)p - (char *)q) + 4) { |
714 | printk ("encode_attr: Attr length calculation error! %u != %Zu\n", | 713 | printk(KERN_ERR "nfs: Attr length error, %u != %Zu\n", |
715 | len, ((char *)p - (char *)q) + 4); | 714 | len, ((char *)p - (char *)q) + 4); |
716 | BUG(); | 715 | BUG(); |
717 | } | 716 | } |
@@ -2180,9 +2179,9 @@ out: | |||
2180 | #define READ_BUF(nbytes) do { \ | 2179 | #define READ_BUF(nbytes) do { \ |
2181 | p = xdr_inline_decode(xdr, nbytes); \ | 2180 | p = xdr_inline_decode(xdr, nbytes); \ |
2182 | if (unlikely(!p)) { \ | 2181 | if (unlikely(!p)) { \ |
2183 | printk(KERN_INFO "%s: prematurely hit end of receive" \ | 2182 | dprintk("nfs: %s: prematurely hit end of receive" \ |
2184 | " buffer\n", __FUNCTION__); \ | 2183 | " buffer\n", __FUNCTION__); \ |
2185 | printk(KERN_INFO "%s: xdr->p=%p, bytes=%u, xdr->end=%p\n", \ | 2184 | dprintk("nfs: %s: xdr->p=%p, bytes=%u, xdr->end=%p\n", \ |
2186 | __FUNCTION__, xdr->p, nbytes, xdr->end); \ | 2185 | __FUNCTION__, xdr->p, nbytes, xdr->end); \ |
2187 | return -EIO; \ | 2186 | return -EIO; \ |
2188 | } \ | 2187 | } \ |
@@ -2223,9 +2222,8 @@ static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected) | |||
2223 | READ_BUF(8); | 2222 | READ_BUF(8); |
2224 | READ32(opnum); | 2223 | READ32(opnum); |
2225 | if (opnum != expected) { | 2224 | if (opnum != expected) { |
2226 | printk(KERN_NOTICE | 2225 | dprintk("nfs: Server returned operation" |
2227 | "nfs4_decode_op_hdr: Server returned operation" | 2226 | " %d but we issued a request for %d\n", |
2228 | " %d but we issued a request for %d\n", | ||
2229 | opnum, expected); | 2227 | opnum, expected); |
2230 | return -EIO; | 2228 | return -EIO; |
2231 | } | 2229 | } |
@@ -2758,7 +2756,7 @@ static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nf | |||
2758 | dprintk("%s: nfs_map_name_to_uid failed!\n", | 2756 | dprintk("%s: nfs_map_name_to_uid failed!\n", |
2759 | __FUNCTION__); | 2757 | __FUNCTION__); |
2760 | } else | 2758 | } else |
2761 | printk(KERN_WARNING "%s: name too long (%u)!\n", | 2759 | dprintk("%s: name too long (%u)!\n", |
2762 | __FUNCTION__, len); | 2760 | __FUNCTION__, len); |
2763 | bitmap[1] &= ~FATTR4_WORD1_OWNER; | 2761 | bitmap[1] &= ~FATTR4_WORD1_OWNER; |
2764 | } | 2762 | } |
@@ -2783,7 +2781,7 @@ static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nf | |||
2783 | dprintk("%s: nfs_map_group_to_gid failed!\n", | 2781 | dprintk("%s: nfs_map_group_to_gid failed!\n", |
2784 | __FUNCTION__); | 2782 | __FUNCTION__); |
2785 | } else | 2783 | } else |
2786 | printk(KERN_WARNING "%s: name too long (%u)!\n", | 2784 | dprintk("%s: name too long (%u)!\n", |
2787 | __FUNCTION__, len); | 2785 | __FUNCTION__, len); |
2788 | bitmap[1] &= ~FATTR4_WORD1_OWNER_GROUP; | 2786 | bitmap[1] &= ~FATTR4_WORD1_OWNER_GROUP; |
2789 | } | 2787 | } |
@@ -2950,7 +2948,8 @@ static int verify_attr_len(struct xdr_stream *xdr, __be32 *savep, uint32_t attrl | |||
2950 | unsigned int nwords = xdr->p - savep; | 2948 | unsigned int nwords = xdr->p - savep; |
2951 | 2949 | ||
2952 | if (unlikely(attrwords != nwords)) { | 2950 | if (unlikely(attrwords != nwords)) { |
2953 | printk(KERN_WARNING "%s: server returned incorrect attribute length: %u %c %u\n", | 2951 | dprintk("%s: server returned incorrect attribute length: " |
2952 | "%u %c %u\n", | ||
2954 | __FUNCTION__, | 2953 | __FUNCTION__, |
2955 | attrwords << 2, | 2954 | attrwords << 2, |
2956 | (attrwords < nwords) ? '<' : '>', | 2955 | (attrwords < nwords) ? '<' : '>', |
@@ -3451,7 +3450,7 @@ static int decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_ | |||
3451 | hdrlen = (u8 *) p - (u8 *) iov->iov_base; | 3450 | hdrlen = (u8 *) p - (u8 *) iov->iov_base; |
3452 | recvd = req->rq_rcv_buf.len - hdrlen; | 3451 | recvd = req->rq_rcv_buf.len - hdrlen; |
3453 | if (count > recvd) { | 3452 | if (count > recvd) { |
3454 | printk(KERN_WARNING "NFS: server cheating in read reply: " | 3453 | dprintk("NFS: server cheating in read reply: " |
3455 | "count %u > recvd %u\n", count, recvd); | 3454 | "count %u > recvd %u\n", count, recvd); |
3456 | count = recvd; | 3455 | count = recvd; |
3457 | eof = 0; | 3456 | eof = 0; |
@@ -3500,7 +3499,8 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n | |||
3500 | p += 2; /* cookie */ | 3499 | p += 2; /* cookie */ |
3501 | len = ntohl(*p++); /* filename length */ | 3500 | len = ntohl(*p++); /* filename length */ |
3502 | if (len > NFS4_MAXNAMLEN) { | 3501 | if (len > NFS4_MAXNAMLEN) { |
3503 | printk(KERN_WARNING "NFS: giant filename in readdir (len 0x%x)\n", len); | 3502 | dprintk("NFS: giant filename in readdir (len 0x%x)\n", |
3503 | len); | ||
3504 | goto err_unmap; | 3504 | goto err_unmap; |
3505 | } | 3505 | } |
3506 | xlen = XDR_QUADLEN(len); | 3506 | xlen = XDR_QUADLEN(len); |
@@ -3528,7 +3528,7 @@ short_pkt: | |||
3528 | entry[0] = entry[1] = 0; | 3528 | entry[0] = entry[1] = 0; |
3529 | /* truncate listing ? */ | 3529 | /* truncate listing ? */ |
3530 | if (!nr) { | 3530 | if (!nr) { |
3531 | printk(KERN_NOTICE "NFS: readdir reply truncated!\n"); | 3531 | dprintk("NFS: readdir reply truncated!\n"); |
3532 | entry[1] = 1; | 3532 | entry[1] = 1; |
3533 | } | 3533 | } |
3534 | goto out; | 3534 | goto out; |
@@ -3554,13 +3554,13 @@ static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req) | |||
3554 | READ_BUF(4); | 3554 | READ_BUF(4); |
3555 | READ32(len); | 3555 | READ32(len); |
3556 | if (len >= rcvbuf->page_len || len <= 0) { | 3556 | if (len >= rcvbuf->page_len || len <= 0) { |
3557 | dprintk(KERN_WARNING "nfs: server returned giant symlink!\n"); | 3557 | dprintk("nfs: server returned giant symlink!\n"); |
3558 | return -ENAMETOOLONG; | 3558 | return -ENAMETOOLONG; |
3559 | } | 3559 | } |
3560 | hdrlen = (char *) xdr->p - (char *) iov->iov_base; | 3560 | hdrlen = (char *) xdr->p - (char *) iov->iov_base; |
3561 | recvd = req->rq_rcv_buf.len - hdrlen; | 3561 | recvd = req->rq_rcv_buf.len - hdrlen; |
3562 | if (recvd < len) { | 3562 | if (recvd < len) { |
3563 | printk(KERN_WARNING "NFS: server cheating in readlink reply: " | 3563 | dprintk("NFS: server cheating in readlink reply: " |
3564 | "count %u > recvd %u\n", len, recvd); | 3564 | "count %u > recvd %u\n", len, recvd); |
3565 | return -EIO; | 3565 | return -EIO; |
3566 | } | 3566 | } |
@@ -3643,7 +3643,7 @@ static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, | |||
3643 | hdrlen = (u8 *)xdr->p - (u8 *)iov->iov_base; | 3643 | hdrlen = (u8 *)xdr->p - (u8 *)iov->iov_base; |
3644 | recvd = req->rq_rcv_buf.len - hdrlen; | 3644 | recvd = req->rq_rcv_buf.len - hdrlen; |
3645 | if (attrlen > recvd) { | 3645 | if (attrlen > recvd) { |
3646 | printk(KERN_WARNING "NFS: server cheating in getattr" | 3646 | dprintk("NFS: server cheating in getattr" |
3647 | " acl reply: attrlen %u > recvd %u\n", | 3647 | " acl reply: attrlen %u > recvd %u\n", |
3648 | attrlen, recvd); | 3648 | attrlen, recvd); |
3649 | return -EINVAL; | 3649 | return -EINVAL; |
@@ -3688,8 +3688,7 @@ static int decode_setclientid(struct xdr_stream *xdr, struct nfs_client *clp) | |||
3688 | READ_BUF(8); | 3688 | READ_BUF(8); |
3689 | READ32(opnum); | 3689 | READ32(opnum); |
3690 | if (opnum != OP_SETCLIENTID) { | 3690 | if (opnum != OP_SETCLIENTID) { |
3691 | printk(KERN_NOTICE | 3691 | dprintk("nfs: decode_setclientid: Server returned operation" |
3692 | "nfs4_decode_setclientid: Server returned operation" | ||
3693 | " %d\n", opnum); | 3692 | " %d\n", opnum); |
3694 | return -EIO; | 3693 | return -EIO; |
3695 | } | 3694 | } |