From owner-svn-src-stable@freebsd.org Sun May 29 23:05:16 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04E5FB54F17; Sun, 29 May 2016 23:05:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C48621FBC; Sun, 29 May 2016 23:05:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4TN5E89076521; Sun, 29 May 2016 23:05:14 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4TN5Eiq076520; Sun, 29 May 2016 23:05:14 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605292305.u4TN5Eiq076520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 29 May 2016 23:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300977 - stable/10/sys/fs/fuse X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2016 23:05:16 -0000 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; }