svn commit: r300977 - stable/10/sys/fs/fuse

Rick Macklem rmacklem at FreeBSD.org
Sun May 29 23:05:16 UTC 2016


Author: rmacklem
Date: Sun May 29 23:05:14 2016
New Revision: 300977
URL: https://svnweb.freebsd.org/changeset/base/300977

Log:
  MFC: r299816
  Fix fuse so that stale buffer cache data isn't read.
  
  When I/O on a file under fuse is switched from buffered to DIRECT_IO,
  it was possible to read stale (before a recent modification) data from
  the buffer cache. This patch invalidates the buffer cache for the
  file to fix this.

Modified:
  stable/10/sys/fs/fuse/fuse_node.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/fuse/fuse_node.c
==============================================================================
--- stable/10/sys/fs/fuse/fuse_node.c	Sun May 29 22:28:39 2016	(r300976)
+++ stable/10/sys/fs/fuse/fuse_node.c	Sun May 29 23:05:14 2016	(r300977)
@@ -289,7 +289,9 @@ fuse_vnode_open(struct vnode *vp, int32_
          * XXXIP: Handle fd based DIRECT_IO
          */
 	if (fuse_open_flags & FOPEN_DIRECT_IO) {
+		ASSERT_VOP_ELOCKED(vp, __func__);
 		VTOFUD(vp)->flag |= FN_DIRECTIO;
+		fuse_io_invalbuf(vp, td);
 	} else {
 	        VTOFUD(vp)->flag &= ~FN_DIRECTIO;
 	}


More information about the svn-src-all mailing list