From owner-svn-src-stable-10@freebsd.org Sun Dec 4 13:56:17 2016 Return-Path: Delivered-To: svn-src-stable-10@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 44D40C6462C; Sun, 4 Dec 2016 13:56:17 +0000 (UTC) (envelope-from kib@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 EF24C693; Sun, 4 Dec 2016 13:56:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB4DuGCQ027821; Sun, 4 Dec 2016 13:56:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4DuFTb027818; Sun, 4 Dec 2016 13:56:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612041356.uB4DuFTb027818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 4 Dec 2016 13:56:15 +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: r309530 - in stable/10/sys: fs/nfsclient fs/nullfs sys 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-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 13:56:17 -0000 Author: kib Date: Sun Dec 4 13:56:15 2016 New Revision: 309530 URL: https://svnweb.freebsd.org/changeset/base/309530 Log: MFC r309209: Do not enable nullfs vnode caching over nfs v4 mounts. Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c stable/10/sys/fs/nullfs/null_vfsops.c stable/10/sys/sys/mount.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvfsops.c Sun Dec 4 13:53:06 2016 (r309529) +++ stable/10/sys/fs/nfsclient/nfs_clvfsops.c Sun Dec 4 13:56:15 2016 (r309530) @@ -1201,6 +1201,8 @@ out: MNT_ILOCK(mp); mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF | MNTK_USES_BCACHE; + if ((VFSTONFS(mp)->nm_flag & NFSMNT_NFSV4) != 0) + mp->mnt_kern_flag |= MNTK_NULL_NOCACHE; MNT_IUNLOCK(mp); } return (error); Modified: stable/10/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/10/sys/fs/nullfs/null_vfsops.c Sun Dec 4 13:53:06 2016 (r309529) +++ stable/10/sys/fs/nullfs/null_vfsops.c Sun Dec 4 13:56:15 2016 (r309530) @@ -188,7 +188,8 @@ nullfs_mount(struct mount *mp) } xmp->nullm_flags |= NULLM_CACHE; - if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0) + if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0 || + (xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) != 0) xmp->nullm_flags &= ~NULLM_CACHE; MNT_ILOCK(mp); Modified: stable/10/sys/sys/mount.h ============================================================================== --- stable/10/sys/sys/mount.h Sun Dec 4 13:53:06 2016 (r309529) +++ stable/10/sys/sys/mount.h Sun Dec 4 13:56:15 2016 (r309530) @@ -362,7 +362,8 @@ void __mnt_vnode_markerfree_act #define MNTK_SUSPEND 0x08000000 /* request write suspension */ #define MNTK_SUSPEND2 0x04000000 /* block secondary writes */ #define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */ -#define MNTK_UNUSED25 0x20000000 /* --available-- */ +#define MNTK_NULL_NOCACHE 0x20000000 /* auto disable cache for nullfs + mounts over this fs */ #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ #define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */