]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/dmu.c
assertion in arc_release() during encrypted receive
authorMatthew Ahrens <mahrens@delphix.com>
Tue, 17 Apr 2018 18:06:54 +0000 (11:06 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 17 Apr 2018 18:06:54 +0000 (11:06 -0700)
commit0c03d21ac99ebdbefe65c319fc3712928c40af78
tree5ec1e603a374a089fcd5b1c5b673974a5e687c1b
parentb40d45bc6c0e908c4d1086ac8ac3dcd1f7178d2a
assertion in arc_release() during encrypted receive

In the existing code, when doing a raw (encrypted) zfs receive,
we call arc_convert_to_raw() from open context. This creates a
race condition between arc_release()/arc_change_state() and
writing out the block from syncing context (arc_write_ready/done()).

This change makes it so that when we are doing a raw (encrypted)
zfs receive, we save the crypt parameters (salt, iv, mac) of dnode
blocks in the dbuf_dirty_record_t, and call arc_convert_to_raw()
from syncing context when writing out the block of dnodes.

Additionally, we can eliminate dr_raw and associated setters, and
instead know that dnode blocks are always raw when doing a zfs
receive (see the new field os_raw_receive).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #7424
Closes #7429
include/sys/dbuf.h
include/sys/dmu.h
include/sys/dmu_objset.h
module/zfs/dbuf.c
module/zfs/dmu.c
module/zfs/dmu_objset.c
module/zfs/dmu_send.c