Author: rmacklem
Date: Tue May 28 22:36:01 2013
New Revision: 251079
URL: http://svnweb.freebsd.org/changeset/base/251079

Log:
  Post-r248567, there were times when the client would return a
  truncated directory for some NFS servers. This turned out to
  be because the size of a directory reported by an NFS server
  can be smaller that the ufs-like directory created from the
  RPC XDR in the client. This patch fixes the problem by changing
  r248567 so that vnode_pager_setsize() is only done for regular files.
  
  Reported and tested by:       hartmut.bra...@dlr.de
  Reviewed by:  kib
  MFC after:    1 week

Modified:
  head/sys/fs/nfsclient/nfs_clport.c

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c  Tue May 28 22:07:31 2013        
(r251078)
+++ head/sys/fs/nfsclient/nfs_clport.c  Tue May 28 22:36:01 2013        
(r251079)
@@ -448,12 +448,10 @@ nfscl_loadattrcache(struct vnode **vpp, 
                                np->n_size = vap->va_size;
                                np->n_flag |= NSIZECHANGED;
                        }
-               } else {
-                       np->n_size = vap->va_size;
-               }
-               if (vap->va_type == VREG || vap->va_type == VDIR) {
                        setnsize = 1;
                        nsize = vap->va_size;
+               } else {
+                       np->n_size = vap->va_size;
                }
        }
        /*
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to