From owner-freebsd-fs@FreeBSD.ORG Wed Apr 17 21:38:11 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E64125B5 for ; Wed, 17 Apr 2013 21:38:11 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id B17478E6 for ; Wed, 17 Apr 2013 21:38:11 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEANoVb1GDaFvO/2dsb2JhbABQhm26MYJqgRp0gh8BAQUjBFIbDgoCAg0ZAlkGiCeqeJJYgSONQwEzB4IzgRMDlwaRFIMnIIFs X-IronPort-AV: E=Sophos;i="4.87,496,1363147200"; d="scan'208";a="26243098" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 17 Apr 2013 17:37:59 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id CB583B4045; Wed, 17 Apr 2013 17:37:59 -0400 (EDT) Date: Wed, 17 Apr 2013 17:37:59 -0400 (EDT) From: Rick Macklem To: Jared Yanovich Message-ID: <1761576953.936301.1366234679793.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20130417063318.GK14599@nightderanger.bender.mtx> Subject: Re: nfs client readdir eofflag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Linux)/6.0.10_GA_2692) Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:38:12 -0000 Jared Yanovich wrote: > Hi, is there a reason why eofflag isn't set in nfsclient readdir()? > > This now allows union mounts to work for NFS above NFS. > This patch looks ok to me. (I don't know, but my guess is that, since only the NFS server used eofflag for a long time, the code just didn't bother setting it.) If you aren't a src committer (I don't recognize your name), I will put testing/committing this patch on my "to do" list. (If you are a src committer, feel free to commit it.) Thanks for reporting this, rick > /sys/fs/nfsclient > > Index: nfs_clvnops.c > =================================================================== > --- nfs_clvnops.c (revision 249568) > +++ nfs_clvnops.c (working copy) > @@ -2221,6 +2221,7 @@ > !NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) { > mtx_unlock(&np->n_mtx); > NFSINCRGLOBAL(newnfsstats.direofcache_hits); > + *ap->a_eofflag = 1; > return (0); > } else > mtx_unlock(&np->n_mtx); > @@ -2233,8 +2234,10 @@ > tresid = uio->uio_resid; > error = ncl_bioread(vp, uio, 0, ap->a_cred); > > - if (!error && uio->uio_resid == tresid) > + if (!error && uio->uio_resid == tresid) { > NFSINCRGLOBAL(newnfsstats.direofcache_misses); > + *ap->a_eofflag = 1; > + } > return (error); > }