aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs3xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs3xdr.c')
-rw-r--r--fs/nfs/nfs3xdr.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index d9e08f0cf2a0..8a225fbe9ee2 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -524,7 +524,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res
524 524
525 hdrlen = (u8 *) p - (u8 *) iov->iov_base; 525 hdrlen = (u8 *) p - (u8 *) iov->iov_base;
526 if (iov->iov_len < hdrlen) { 526 if (iov->iov_len < hdrlen) {
527 printk(KERN_WARNING "NFS: READDIR reply header overflowed:" 527 dprintk("NFS: READDIR reply header overflowed:"
528 "length %d > %Zu\n", hdrlen, iov->iov_len); 528 "length %d > %Zu\n", hdrlen, iov->iov_len);
529 return -errno_NFSERR_IO; 529 return -errno_NFSERR_IO;
530 } else if (iov->iov_len != hdrlen) { 530 } else if (iov->iov_len != hdrlen) {
@@ -547,7 +547,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res
547 len = ntohl(*p++); /* string length */ 547 len = ntohl(*p++); /* string length */
548 p += XDR_QUADLEN(len) + 2; /* name + cookie */ 548 p += XDR_QUADLEN(len) + 2; /* name + cookie */
549 if (len > NFS3_MAXNAMLEN) { 549 if (len > NFS3_MAXNAMLEN) {
550 printk(KERN_WARNING "NFS: giant filename in readdir (len %x)!\n", 550 dprintk("NFS: giant filename in readdir (len %x)!\n",
551 len); 551 len);
552 goto err_unmap; 552 goto err_unmap;
553 } 553 }
@@ -567,7 +567,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res
567 goto short_pkt; 567 goto short_pkt;
568 len = ntohl(*p++); 568 len = ntohl(*p++);
569 if (len > NFS3_FHSIZE) { 569 if (len > NFS3_FHSIZE) {
570 printk(KERN_WARNING "NFS: giant filehandle in " 570 dprintk("NFS: giant filehandle in "
571 "readdir (len %x)!\n", len); 571 "readdir (len %x)!\n", len);
572 goto err_unmap; 572 goto err_unmap;
573 } 573 }
@@ -588,7 +588,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res
588 entry[0] = entry[1] = 0; 588 entry[0] = entry[1] = 0;
589 /* truncate listing ? */ 589 /* truncate listing ? */
590 if (!nr) { 590 if (!nr) {
591 printk(KERN_NOTICE "NFS: readdir reply truncated!\n"); 591 dprintk("NFS: readdir reply truncated!\n");
592 entry[1] = 1; 592 entry[1] = 1;
593 } 593 }
594 goto out; 594 goto out;
@@ -826,22 +826,23 @@ nfs3_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr)
826 /* Convert length of symlink */ 826 /* Convert length of symlink */
827 len = ntohl(*p++); 827 len = ntohl(*p++);
828 if (len >= rcvbuf->page_len || len <= 0) { 828 if (len >= rcvbuf->page_len || len <= 0) {
829 dprintk(KERN_WARNING "nfs: server returned giant symlink!\n"); 829 dprintk("nfs: server returned giant symlink!\n");
830 return -ENAMETOOLONG; 830 return -ENAMETOOLONG;
831 } 831 }
832 832
833 hdrlen = (u8 *) p - (u8 *) iov->iov_base; 833 hdrlen = (u8 *) p - (u8 *) iov->iov_base;
834 if (iov->iov_len < hdrlen) { 834 if (iov->iov_len < hdrlen) {
835 printk(KERN_WARNING "NFS: READLINK reply header overflowed:" 835 dprintk("NFS: READLINK reply header overflowed:"
836 "length %d > %Zu\n", hdrlen, iov->iov_len); 836 "length %d > %Zu\n", hdrlen, iov->iov_len);
837 return -errno_NFSERR_IO; 837 return -errno_NFSERR_IO;
838 } else if (iov->iov_len != hdrlen) { 838 } else if (iov->iov_len != hdrlen) {
839 dprintk("NFS: READLINK header is short. iovec will be shifted.\n"); 839 dprintk("NFS: READLINK header is short. "
840 "iovec will be shifted.\n");
840 xdr_shift_buf(rcvbuf, iov->iov_len - hdrlen); 841 xdr_shift_buf(rcvbuf, iov->iov_len - hdrlen);
841 } 842 }
842 recvd = req->rq_rcv_buf.len - hdrlen; 843 recvd = req->rq_rcv_buf.len - hdrlen;
843 if (recvd < len) { 844 if (recvd < len) {
844 printk(KERN_WARNING "NFS: server cheating in readlink reply: " 845 dprintk("NFS: server cheating in readlink reply: "
845 "count %u > recvd %u\n", len, recvd); 846 "count %u > recvd %u\n", len, recvd);
846 return -EIO; 847 return -EIO;
847 } 848 }
@@ -876,13 +877,13 @@ nfs3_xdr_readres(struct rpc_rqst *req, __be32 *p, struct nfs_readres *res)
876 ocount = ntohl(*p++); 877 ocount = ntohl(*p++);
877 878
878 if (ocount != count) { 879 if (ocount != count) {
879 printk(KERN_WARNING "NFS: READ count doesn't match RPC opaque count.\n"); 880 dprintk("NFS: READ count doesn't match RPC opaque count.\n");
880 return -errno_NFSERR_IO; 881 return -errno_NFSERR_IO;
881 } 882 }
882 883
883 hdrlen = (u8 *) p - (u8 *) iov->iov_base; 884 hdrlen = (u8 *) p - (u8 *) iov->iov_base;
884 if (iov->iov_len < hdrlen) { 885 if (iov->iov_len < hdrlen) {
885 printk(KERN_WARNING "NFS: READ reply header overflowed:" 886 dprintk("NFS: READ reply header overflowed:"
886 "length %d > %Zu\n", hdrlen, iov->iov_len); 887 "length %d > %Zu\n", hdrlen, iov->iov_len);
887 return -errno_NFSERR_IO; 888 return -errno_NFSERR_IO;
888 } else if (iov->iov_len != hdrlen) { 889 } else if (iov->iov_len != hdrlen) {
@@ -892,7 +893,7 @@ nfs3_xdr_readres(struct rpc_rqst *req, __be32 *p, struct nfs_readres *res)
892 893
893 recvd = req->rq_rcv_buf.len - hdrlen; 894 recvd = req->rq_rcv_buf.len - hdrlen;
894 if (count > recvd) { 895 if (count > recvd) {
895 printk(KERN_WARNING "NFS: server cheating in read reply: " 896 dprintk("NFS: server cheating in read reply: "
896 "count %d > recvd %d\n", count, recvd); 897 "count %d > recvd %d\n", count, recvd);
897 count = recvd; 898 count = recvd;
898 res->eof = 0; 899 res->eof = 0;