aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs2xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs2xdr.c')
-rw-r--r--fs/nfs/nfs2xdr.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index c5fce7567200..668ab96c7b59 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -251,6 +251,7 @@ nfs_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args)
251 replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS_readres_sz) << 2; 251 replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS_readres_sz) << 2;
252 xdr_inline_pages(&req->rq_rcv_buf, replen, 252 xdr_inline_pages(&req->rq_rcv_buf, replen,
253 args->pages, args->pgbase, count); 253 args->pages, args->pgbase, count);
254 req->rq_rcv_buf.flags |= XDRBUF_READ;
254 return 0; 255 return 0;
255} 256}
256 257
@@ -271,7 +272,7 @@ nfs_xdr_readres(struct rpc_rqst *req, __be32 *p, struct nfs_readres *res)
271 res->eof = 0; 272 res->eof = 0;
272 hdrlen = (u8 *) p - (u8 *) iov->iov_base; 273 hdrlen = (u8 *) p - (u8 *) iov->iov_base;
273 if (iov->iov_len < hdrlen) { 274 if (iov->iov_len < hdrlen) {
274 printk(KERN_WARNING "NFS: READ reply header overflowed:" 275 dprintk("NFS: READ reply header overflowed:"
275 "length %d > %Zu\n", hdrlen, iov->iov_len); 276 "length %d > %Zu\n", hdrlen, iov->iov_len);
276 return -errno_NFSERR_IO; 277 return -errno_NFSERR_IO;
277 } else if (iov->iov_len != hdrlen) { 278 } else if (iov->iov_len != hdrlen) {
@@ -281,7 +282,7 @@ nfs_xdr_readres(struct rpc_rqst *req, __be32 *p, struct nfs_readres *res)
281 282
282 recvd = req->rq_rcv_buf.len - hdrlen; 283 recvd = req->rq_rcv_buf.len - hdrlen;
283 if (count > recvd) { 284 if (count > recvd) {
284 printk(KERN_WARNING "NFS: server cheating in read reply: " 285 dprintk("NFS: server cheating in read reply: "
285 "count %d > recvd %d\n", count, recvd); 286 "count %d > recvd %d\n", count, recvd);
286 count = recvd; 287 count = recvd;
287 } 288 }
@@ -313,6 +314,7 @@ nfs_xdr_writeargs(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args)
313 314
314 /* Copy the page array */ 315 /* Copy the page array */
315 xdr_encode_pages(sndbuf, args->pages, args->pgbase, count); 316 xdr_encode_pages(sndbuf, args->pages, args->pgbase, count);
317 sndbuf->flags |= XDRBUF_WRITE;
316 return 0; 318 return 0;
317} 319}
318 320
@@ -431,7 +433,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, __be32 *p, void *dummy)
431 433
432 hdrlen = (u8 *) p - (u8 *) iov->iov_base; 434 hdrlen = (u8 *) p - (u8 *) iov->iov_base;
433 if (iov->iov_len < hdrlen) { 435 if (iov->iov_len < hdrlen) {
434 printk(KERN_WARNING "NFS: READDIR reply header overflowed:" 436 dprintk("NFS: READDIR reply header overflowed:"
435 "length %d > %Zu\n", hdrlen, iov->iov_len); 437 "length %d > %Zu\n", hdrlen, iov->iov_len);
436 return -errno_NFSERR_IO; 438 return -errno_NFSERR_IO;
437 } else if (iov->iov_len != hdrlen) { 439 } else if (iov->iov_len != hdrlen) {
@@ -454,7 +456,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, __be32 *p, void *dummy)
454 len = ntohl(*p++); 456 len = ntohl(*p++);
455 p += XDR_QUADLEN(len) + 1; /* name plus cookie */ 457 p += XDR_QUADLEN(len) + 1; /* name plus cookie */
456 if (len > NFS2_MAXNAMLEN) { 458 if (len > NFS2_MAXNAMLEN) {
457 printk(KERN_WARNING "NFS: giant filename in readdir (len 0x%x)!\n", 459 dprintk("NFS: giant filename in readdir (len 0x%x)!\n",
458 len); 460 len);
459 goto err_unmap; 461 goto err_unmap;
460 } 462 }
@@ -471,7 +473,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, __be32 *p, void *dummy)
471 entry[0] = entry[1] = 0; 473 entry[0] = entry[1] = 0;
472 /* truncate listing ? */ 474 /* truncate listing ? */
473 if (!nr) { 475 if (!nr) {
474 printk(KERN_NOTICE "NFS: readdir reply truncated!\n"); 476 dprintk("NFS: readdir reply truncated!\n");
475 entry[1] = 1; 477 entry[1] = 1;
476 } 478 }
477 goto out; 479 goto out;
@@ -583,12 +585,12 @@ nfs_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, void *dummy)
583 /* Convert length of symlink */ 585 /* Convert length of symlink */
584 len = ntohl(*p++); 586 len = ntohl(*p++);
585 if (len >= rcvbuf->page_len || len <= 0) { 587 if (len >= rcvbuf->page_len || len <= 0) {
586 dprintk(KERN_WARNING "nfs: server returned giant symlink!\n"); 588 dprintk("nfs: server returned giant symlink!\n");
587 return -ENAMETOOLONG; 589 return -ENAMETOOLONG;
588 } 590 }
589 hdrlen = (u8 *) p - (u8 *) iov->iov_base; 591 hdrlen = (u8 *) p - (u8 *) iov->iov_base;
590 if (iov->iov_len < hdrlen) { 592 if (iov->iov_len < hdrlen) {
591 printk(KERN_WARNING "NFS: READLINK reply header overflowed:" 593 dprintk("NFS: READLINK reply header overflowed:"
592 "length %d > %Zu\n", hdrlen, iov->iov_len); 594 "length %d > %Zu\n", hdrlen, iov->iov_len);
593 return -errno_NFSERR_IO; 595 return -errno_NFSERR_IO;
594 } else if (iov->iov_len != hdrlen) { 596 } else if (iov->iov_len != hdrlen) {
@@ -597,7 +599,7 @@ nfs_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, void *dummy)
597 } 599 }
598 recvd = req->rq_rcv_buf.len - hdrlen; 600 recvd = req->rq_rcv_buf.len - hdrlen;
599 if (recvd < len) { 601 if (recvd < len) {
600 printk(KERN_WARNING "NFS: server cheating in readlink reply: " 602 dprintk("NFS: server cheating in readlink reply: "
601 "count %u > recvd %u\n", len, recvd); 603 "count %u > recvd %u\n", len, recvd);
602 return -EIO; 604 return -EIO;
603 } 605 }
@@ -695,7 +697,7 @@ nfs_stat_to_errno(int stat)
695 if (nfs_errtbl[i].stat == stat) 697 if (nfs_errtbl[i].stat == stat)
696 return nfs_errtbl[i].errno; 698 return nfs_errtbl[i].errno;
697 } 699 }
698 printk(KERN_ERR "nfs_stat_to_errno: bad nfs status return value: %d\n", stat); 700 dprintk("nfs_stat_to_errno: bad nfs status return value: %d\n", stat);
699 return nfs_errtbl[i].errno; 701 return nfs_errtbl[i].errno;
700} 702}
701 703