FW: Shell copy_file() issue with NFS and small MAC receive buffer

Kirspel, Kevin kevin.kirspel at optimedical.com
Thu Mar 31 23:55:12 UTC 2011


I have solved the issue (See patch below).  There was another bug in the nfs_do_evalpath() function related to the union that was added for 4.10.  It's also in the patch.

--- nfs_old.c       2010-07-01 11:18:06.000000000 -0400
+++ nfs.c             2011-03-31 19:47:08.000000000 -0400
@@ -1574,7 +1575,7 @@
                                 */
                                assert( node->args.name );

-                              *(const char**)arg = pathname + (node->args.name - p);
+                             *(arg->c) = pathname + (node->args.name - p);

 #if 0
                                /* restore the directory node */
@@ -2616,6 +2617,9 @@
                if (count > NFS_MAXDATA)
                                count = NFS_MAXDATA;

+             if (count > nfsStBlksize)
+                             count = nfsStBlksize;
+
                SERP_ARGS(node).readarg.offset                           = iop->offset;
                SERP_ARGS(node).readarg.count                            = count;
                SERP_ARGS(node).readarg.totalcount   = UINT32_C(0xdeadbeef);
@@ -2720,6 +2724,8 @@
                if (count > NFS_MAXDATA)
                                count = NFS_MAXDATA;

+             if (count > nfsStBlksize)
+                             count = nfsStBlksize;

                SERP_ARGS(node).writearg.beginoffset   = UINT32_C(0xdeadbeef);
                if ( LIBIO_FLAGS_APPEND & iop->flags ) {

From: Kirspel, Kevin
Sent: Thursday, March 31, 2011 5:59 PM
To: rtems-users at rtems.org
Subject: Shell copy_file() issue with NFS and small MAC receive buffer

I am upgrading from 4.9 to 4.10 and I have come across an issue between the RTEMS shell and NFS networking.

In 4.10, I cannot copy files from an NFS share to the RTEMS file system (which works fine in 4.9).  I traced it back to the copy_file() function in the RTEMS shell (utils-cp.c).  In the 4.9 version, the buffer size was set to 4096.  In 4.10, the buffer size is set to 8192.  This causes a problem with my NFS because my Ethernet MAC/PHY only has a 8192 receive buffer.  I have to set the NFS nfsStBlksize to 4096 to prevent buffer overflows.  The copy_file() function is requesting 8192 bytes from the nfs_file_read() function which has only a4096 block size.  In this case, the NFS server does not respond to the request.  I get the following error:

RPCIO: server '192.168.21.204' not responding - still trying
NFS (proc 6) - RPC: Timed out

What is the appropriate way to fix this scenario?  Should I have a while loop in the nfs_file_read() function to process multiple NFS requests until I get all the bytes needed?

Kevin Kirspel
Senior Electrical Engineer
Opti Medical
235 Hembree Park Drive
Roswell GA 30076
Tel: (770)-510-4444 ext. 81642
Direct: (770)-688-1642
Fax: (770)-510-4445

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20110331/46bcfe5a/attachment.html>


More information about the users mailing list