Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/fs/puffs/puffs_vnops.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/fs/puffs/puffs_vnops.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.163.2.10 retrieving revision 1.163.2.11 diff -u -p -r1.163.2.10 -r1.163.2.11 --- src/sys/fs/puffs/puffs_vnops.c 2014/11/09 11:05:15 1.163.2.10 +++ src/sys/fs/puffs/puffs_vnops.c 2015/01/16 19:44:53 1.163.2.11 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_vnops.c,v 1.163.2.10 2014/11/09 11:05:15 msaitoh Exp $ */ +/* $NetBSD: puffs_vnops.c,v 1.163.2.11 2015/01/16 19:44:53 martin Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.163.2.10 2014/11/09 11:05:15 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.163.2.11 2015/01/16 19:44:53 martin Exp $"); #include #include @@ -2261,9 +2261,17 @@ puffs_vnop_read(void *v) 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) {