Date: Sun, 15 May 2016 00:45:17 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299816 - head/sys/fs/fuse Message-ID: <201605150045.u4F0jHTm009911@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sun May 15 00:45:17 2016 New Revision: 299816 URL: https://svnweb.freebsd.org/changeset/base/299816 Log: 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. PR: 194293 MFC after: 2 weeks Modified: head/sys/fs/fuse/fuse_node.c Modified: head/sys/fs/fuse/fuse_node.c ============================================================================== --- head/sys/fs/fuse/fuse_node.c Sun May 15 00:42:18 2016 (r299815) +++ head/sys/fs/fuse/fuse_node.c Sun May 15 00:45:17 2016 (r299816) @@ -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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605150045.u4F0jHTm009911>