Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Oct 2017 15:43:38 +0000 (UTC)
From:      Matt Joras <mjoras@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324921 - head/sys/fs/tmpfs
Message-ID:  <201710231543.v9NFhcUe023744@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710231543.v9NFhcUe023744>