freebsd-nq/sys/fs
Konstantin Belousov 4cda7f7ece Rework the tmpfs unmount.
- Suspend filesystem for unmount.  This prevents new tmpfs nodes from
  instantiating, and also ensures that only unmount thread can destroy
  nodes.

- Do not start tmpfs node deletion until all vnodes are reclaimed,
  which guarantees that no thread can access tmpfs data.  For this,
  call vflush() in the loop, until the mnt_nvnodelistsize is non-zero.
  Note that after mnt_nvnodelistsize becomes 0, insmntque() blocks
  insertion of a vnode germ into the mount list of vnodes.

- Fail node allocation when the filesystem is being unmounted.  This
  is race-free due to the vflush() call in loop.  This is mostly
  cosmetic, avoiding some more work which might be done until
  suspension in unmount is started.

Note that there is currently no way to prevent new vnode instantiation
from readers during the unmount.  Due to this, forced unmount might
live-lock if vflush() loop cannot get to the zero vnode count due to
races with readers.  The unmount would proceed after the load is
lifted.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2014-07-14 09:52:33 +00:00
..
cd9660 Generalize vn_get_ino() to allow filesystems to use custom vnode 2014-07-14 08:34:54 +00:00
cuse Use existing PHOLD() and PRELE() macros. 2014-06-24 18:25:43 +00:00
deadfs
devfs In msdosfs_setattr(), add a check for result of the utimes(2) 2014-06-17 07:11:00 +00:00
ext2fs Revert r263449; 2014-03-21 04:33:38 +00:00
fdescfs Update kernel inclusions of capability.h to use capsicum.h instead; some 2014-03-16 10:55:57 +00:00
fifofs Ignore the error from pipespace_new when creating a pipe. 2014-05-02 00:52:13 +00:00
fuse Update kernel inclusions of capability.h to use capsicum.h instead; some 2014-03-16 10:55:57 +00:00
msdosfs Generalize vn_get_ino() to allow filesystems to use custom vnode 2014-07-14 08:34:54 +00:00
nandfs Naughty NANDFS was using hidden unused flag, hiding the fact that the 2014-07-07 23:21:07 +00:00
nfs Merge the NFSv4.1 server code in projects/nfsv4.1-server over 2014-07-01 20:47:16 +00:00
nfsclient Merge the NFSv4.1 server code in projects/nfsv4.1-server over 2014-07-01 20:47:16 +00:00
nfsserver The new NFSv3 server did not generate directory postop attributes for 2014-07-04 22:47:07 +00:00
nullfs
procfs
pseudofs Redo r258088 to avoid relying on signed arithmetic overflow, since 2013-11-20 19:41:00 +00:00
smbfs Use SMB_QUERY_FS_SIZE_INFO request to populate statfs structure. 2014-04-15 09:10:01 +00:00
tmpfs Rework the tmpfs unmount. 2014-07-14 09:52:33 +00:00
udf
unionfs