Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/fs/puffs Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/ede9c186ad65
branches:  netbsd-7
changeset: 798849:ede9c186ad65
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Jan 17 11:49:09 2015 +0000

description:
Pull up following revision(s) (requested by manu in ticket #423):
        sys/fs/puffs/puffs_vnops.c: revision 1.199
Make sure reads on empty files reach PUFFS filesystems
Sending a read through the page cache will get the operation
short-circuited. This is a problem with some filesystems that
expect to receive the read operation in order to update atime.
We fix that by bypassing the page cache when reading a file
wich a size known to be zero.

diffstat:

 sys/fs/puffs/puffs_vnops.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 83bb4347ba21 -r ede9c186ad65 sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c        Sat Jan 17 11:47:27 2015 +0000
+++ b/sys/fs/puffs/puffs_vnops.c        Sat Jan 17 11:49:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_vnops.c,v 1.182.2.11 2014/11/09 10:09:32 msaitoh Exp $   */
+/*     $NetBSD: puffs_vnops.c,v 1.182.2.12 2015/01/17 11:49:09 martin Exp $    */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.182.2.11 2014/11/09 10:09:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.182.2.12 2015/01/17 11:49:09 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -2279,9 +2279,17 @@
        if (uio->uio_offset < 0)
                return EFBIG;
 
+       /*
+        * On the case of reading empty files and (vp->v_size != 0) below:
+        * some filesystems (hint: FUSE and distributed filesystems) still
+        * expect to get the READ in order to update atime. Reading through
+        * the case filters empty files, therefore we prefer to bypass the
+        * cache here.
+        */
        if (vp->v_type == VREG &&
            PUFFS_USE_PAGECACHE(pmp) &&
-           !(pn->pn_stat & PNODE_RDIRECT)) {
+           !(pn->pn_stat & PNODE_RDIRECT) &&
+           (vp->v_size != 0)) {
                const int advice = IO_ADV_DECODE(ap->a_ioflag);
 
                while (uio->uio_resid > 0) {



Home | Main Index | Thread Index | Old Index