behlendorf approved this pull request.

Looks good.  While reviewing I took the opportunity to [port this to 
Linux](https://github.com/zfsonlinux/zfs/pull/7980).

My only concern is the use of the `cv_broadcast(); cv_destroy();` construct.  
This was always dodgy because once `cv_destroy()` was called no process could 
safely access the cv except to wake up and exit `cv_wait()`.  `cv_destroy()` 
does block for all current waiters to exit so there's no use-after-free issue, 
but no new waiters are allowed, and according to the commit logs we ran in to 
some deadlocks with the VFS due to the waiting.  I believe @lundman ran in to 
the same issue, I don't think this ever a problem for illumos of FreeBSD simply 
due to VFS differences.

This is all to say there's a good chance that at least on Linux we're going to 
need to add back in our fix for this issue which was to defer the 
`cv_destroy()` until the end of `zfs_range_unlock()`.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/680#pullrequestreview-160924430
------------------------------------------
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/T0ada5cf1c6037d04-M50c5b4189022d5338b133155
Delivery options: https://openzfs.topicbox.com/groups/developer/subscription

Reply via email to