freebsd-dev/sys
Andriy Gapon f79bc17233 zfs: honour and make use of vfs vnode locking protocol
ZFS POSIX Layer is originally written for Solaris VFS which is very
different from FreeBSD VFS.  Most importantly many things that FreeBSD VFS
manages on behalf of all filesystems are implemented in ZPL in a different
way.
Thus, ZPL contains code that is redundant on FreeBSD or duplicates VFS
functionality or, in the worst cases, badly interacts / interferes
with VFS.

The most prominent problem is a deadlock caused by the lock order reversal
of vnode locks that may happen with concurrent zfs_rename() and lookup().
The deadlock is a result of zfs_rename() not observing the vnode locking
contract expected by VFS.

This commit removes all ZPL internal locking that protects parent-child
relationships of filesystem nodes.  These relationships are protected
by vnode locks and the code is changed to take advantage of that fact
and to properly interact with VFS.

Removal of the internal locking allowed all ZPL dmu_tx_assign calls to
use TXG_WAIT mode.

Another victim, disputable perhaps, is ZFS support for filesystems with
mixed case sensitivity.  That support is not provided by the OS anyway,
so in ZFS it was a buch of dead code.

To do:
- replace ZFS_ENTER mechanism with VFS managed / visible mechanism
- replace zfs_zget with zfs_vget[f] as much as possible
- get rid of not really useful now zfs_freebsd_* adapters
- more cleanups of unneeded / unused code
- fix / replace .zfs support

PR:		209158
Reported by:	many
Tested by:	many (thank you all!)
MFC after:	5 days
Sponsored by:	HybridCluster / ClusterHQ
Differential Revision: https://reviews.freebsd.org/D6533
2016-08-05 06:23:06 +00:00
..
amd64 Don't permit mappings of invalid physical addresses on amd64 via /dev/mem. 2016-08-04 17:55:23 +00:00
arm We need aw_nmi to be attached which needs GIC so attach a bit later. 2016-08-03 18:45:56 +00:00
arm64 Remove the pvh_global_lock lock from the arm64 pmap. It is unneeded on arm64 2016-08-04 13:49:36 +00:00
boot report sector size and number of sectors in lsdev output for bios disks 2016-08-04 06:40:51 +00:00
bsm Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4: 2015-12-20 23:22:04 +00:00
cam Move protocol specific stuff into a linker set object that's 2016-07-28 22:55:21 +00:00
cddl zfs: honour and make use of vfs vnode locking protocol 2016-08-05 06:23:06 +00:00
compat Regenerate after r303755. 2016-08-04 19:15:51 +00:00
conf Merge i386 and amd64 variants of mp_watchdog.c into x86/, there is no 2016-08-03 13:51:53 +00:00
contrib Remove usage of _WITH_DPRINTF 2016-07-30 01:16:06 +00:00
crypto Connect the SHA-512t256 and Skein hashing algorithms to ZFS 2016-05-31 04:12:14 +00:00
ddb Fix ddb "show proc" to show full arguments 2016-08-01 22:41:50 +00:00
dev ioat(4): Log channel number in CTR events 2016-08-05 02:56:31 +00:00
fs Remove ncl_printf(), use printf(9) directly. After r303710 the 2016-08-03 15:58:20 +00:00
gdb
geom Do not invoke resize event if initial disk size is zero. Some disks 2016-08-01 20:54:54 +00:00
gnu Revert changes for local testing, inadvertantly commited in r300811. 2016-05-26 23:59:42 +00:00
i386 Merge i386 and amd64 variants of mp_watchdog.c into x86/, there is no 2016-08-03 13:51:53 +00:00
isa sys/isa: minor spelling fixes. 2016-05-03 21:51:52 +00:00
kern Regenerate after r303755. 2016-08-04 19:15:51 +00:00
kgssapi kgssapi: insignificant spelling fix. 2016-05-03 22:05:03 +00:00
libkern sys: Make use of our rounddown() macro when sys/param.h is available. 2016-04-30 14:41:18 +00:00
mips Add in tap/tun for openvpn-on-mips experiments. 2016-08-04 01:49:18 +00:00
modules netgraph module for reconstructing checksums 2016-08-01 12:09:04 +00:00
net Add __printflike() to bus_describe_intr() to enable -Wformat checks. 2016-08-04 18:29:16 +00:00
net80211 [net80211] teach AMRR to log the initial MCS rate as "MCS X" 2016-07-01 19:58:13 +00:00
netgraph netgraph module for reconstructing checksums 2016-08-01 12:09:04 +00:00
netinet tcp/lro: Implement hash table for LRO entries. 2016-08-02 06:36:47 +00:00
netinet6 Fix NULL pointer dereference. 2016-08-02 12:18:06 +00:00
netipsec Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
netnatm
netpfil Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
netsmb sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
nfs Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
nfsclient
nfsserver
nlm When sleeping waiting for either local or remote advisory lock, 2016-06-26 20:08:42 +00:00
ofed ipoib: Bound the number of egress mbufs buffered during pathrec lookups. 2016-08-01 22:22:11 +00:00
opencrypto opencrypto AES-ICM: Fix heap corruption typo 2016-08-01 22:57:03 +00:00
pc98 Move 'device pci' for the PCI bus driver to the MI NOTES file. 2016-04-29 23:53:55 +00:00
powerpc Merge MPC85XX and QorIQ config options 2016-08-03 01:22:11 +00:00
riscv Update RISC-V port to Privileged Architecture Version 1.9. 2016-08-02 14:50:14 +00:00
rpc Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
security Add AUE_WAIT6 handling to the BSM conversion switch statement, reusing 2016-07-11 13:06:17 +00:00
sparc64 Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
sys Regenerate after r303755. 2016-08-04 19:15:51 +00:00
teken
tests
tools
ufs Ensure that the UFS directory vnode' vm_object is properly sized 2016-07-20 14:40:56 +00:00
vm Clean up the comments and code style in and around vm_pageout_cluster(). 2016-08-04 16:20:12 +00:00
x86 Add __printflike() to bus_describe_intr() to enable -Wformat checks. 2016-08-04 18:29:16 +00:00
xdr
xen xen: Correct typo in #undef for symbol NBPL 2016-06-06 14:55:46 +00:00
Makefile