From owner-svn-src-head@freebsd.org Mon Oct 23 15:43:39 2017 Return-Path: Delivered-To: svn-src-head@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 7DB97E4E551; Mon, 23 Oct 2017 15:43:39 +0000 (UTC) (envelope-from mjoras@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 4027B74942; Mon, 23 Oct 2017 15:43:39 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9NFhcHl023745; Mon, 23 Oct 2017 15:43:38 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9NFhcUe023744; Mon, 23 Oct 2017 15:43:38 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201710231543.v9NFhcUe023744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Mon, 23 Oct 2017 15:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324921 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 324921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2017 15:43:39 -0000 Author: mjoras Date: Mon Oct 23 15:43:38 2017 New Revision: 324921 URL: https://svnweb.freebsd.org/changeset/base/324921 Log: Move clear_unrhdr to tmpfs_free_tmp. Clearing the unr in tmpfs_unmount is not correct. In the case of multiple references to the tmpfs mount (e.g. when there are lookup threads using it) it will not be the one to finish tmpfs_free_tmp. In those cases tmpfs_free_node_locked will be the final one to execute tmpfs_free_tmp, and until then the unr must be valid. Reported by: pho Approved/reviewed by: rstone (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12749 Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Oct 23 15:34:05 2017 (r324920) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Oct 23 15:43:38 2017 (r324921) @@ -317,8 +317,6 @@ tmpfs_unmount(struct mount *mp, int mntflags) TMPFS_NODE_UNLOCK(node); } - clear_unrhdr(tmp->tm_ino_unr); - mp->mnt_data = NULL; tmpfs_free_tmp(tmp); vfs_write_resume(mp, VR_START_WRITE); @@ -344,6 +342,7 @@ tmpfs_free_tmp(struct tmpfs_mount *tmp) uma_zdestroy(tmp->tm_dirent_pool); uma_zdestroy(tmp->tm_node_pool); + clear_unrhdr(tmp->tm_ino_unr); delete_unrhdr(tmp->tm_ino_unr); mtx_destroy(&tmp->tm_allnode_lock);