diff options
author | Chunwei Chen <[email protected]> | 2017-01-19 13:56:36 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-01-19 13:56:36 -0800 |
commit | 040dab993936d832df4c7624bbcdb71c3fb9b34b (patch) | |
tree | 0261aedba3c5e6fdda94a0a10388d065f0802924 /module/zfs/zfs_rlock.c | |
parent | 76fe529b392068dfb7575739542cd4f69d2d4343 (diff) |
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 <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes #4866
Closes #5609
Diffstat (limited to 'module/zfs/zfs_rlock.c')
0 files changed, 0 insertions, 0 deletions