svn commit: r303763 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys

Bryan Drewery bdrewery at FreeBSD.org
Fri Aug 5 16:23:31 UTC 2016


On 8/5/2016 8:53 AM, Glen Barber wrote:
> On Fri, Aug 05, 2016 at 06:23:06AM +0000, Andriy Gapon wrote:
>> Author: avg
>> Date: Fri Aug  5 06:23:06 2016
>> New Revision: 303763
>> URL: https://svnweb.freebsd.org/changeset/base/303763
>>
>> Log:
>>   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
>>
> 
> Thank you very much for working on this.
> 

Yes agreed. It scares me, but releasing with trivial deadlocks that we
cannot EN due to that risk scares me more.  FreeBSD's ZFS is a huge
selling point for it and we want to maintain that.


-- 
Regards,
Bryan Drewery

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20160805/13e16047/attachment.sig>


More information about the svn-src-all mailing list