Chunwei Chen 040dab9939 Suspend/resume zvol for recv and rollback
When doing recv and rollback, dsl_dataset_clone_swap_sync_impl will be
called to swap out the ds_objset and do dmu_objset_evict on the old one.
However, currently zv->zv_objset will not be swapped out accordingly, so
if anyone currently holds a fd on the zvol, we risk hitting a use-after-free.

We fix this by introducing the suspend and resume mechanism of zsb to
zv.  Before recv or rollback, we use zvol_suspend to block all access to
zv_objset and shut it down. After the recv or rollback, we use zvol_resume
to swap in zv_objset with the new ds_objset and unblock the access.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #4866 
Closes #5609
2017-01-19 13:56:36 -08:00
..
2016-11-29 14:34:33 -08:00
2017-01-03 11:31:18 -06:00
2014-08-01 14:28:05 -07:00
2016-01-08 15:08:19 -08:00
2016-09-29 15:55:41 -07:00
2016-06-28 13:47:02 -07:00
2017-01-13 14:58:41 -08:00
2017-01-13 14:58:41 -08:00
2017-01-03 11:31:18 -06:00
2014-07-29 10:55:29 -07:00
2013-11-04 11:18:14 -08:00
2013-11-04 11:17:48 -08:00
2017-01-03 11:31:18 -06:00
2014-08-13 10:35:00 -07:00
2016-04-21 09:49:25 -07:00
2016-06-07 09:16:52 -07:00
2014-07-30 09:20:35 -07:00
2016-06-24 13:13:21 -07:00
2016-12-01 16:39:06 -07:00
2016-12-02 16:57:49 -07:00
2015-01-06 16:53:24 -08:00
2017-01-03 11:31:18 -06:00
2011-02-10 09:21:43 -08:00
2013-11-04 10:55:25 -08:00
2017-01-03 11:31:18 -06:00
2017-01-13 14:58:41 -08:00
2013-11-04 10:55:25 -08:00
2013-12-18 16:46:35 -08:00
2016-11-04 10:46:40 -07:00
2016-05-17 10:40:30 -07:00
2016-11-04 10:46:40 -07:00
2016-08-12 10:30:16 -07:00
2016-12-12 10:46:26 -08:00