svn commit: r324921 - head/sys/fs/tmpfs

Matt Joras mjoras at FreeBSD.org
Mon Oct 23 15:43:39 UTC 2017


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);


More information about the svn-src-all mailing list