mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Raw receive functions must not decrypt data
This patch fixes a small bug found where receive_spill() sometimes attempted to decrypt spill blocks when doing a raw receive. In addition, this patch fixes another small issue in arc_buf_fill()'s error handling where a decryption failure (which could be caused by the first bug) would attempt to set the arc header's IO_ERROR flag without holding the header's lock. Reviewed-by: Matthew Thode <prometheanfire@gentoo.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: Tom Caputi <tcaputi@datto.com> Closes #7564 Closes #7584 Closes #7592
This commit is contained in:
committed by
Brian Behlendorf
parent
6969afcefd
commit
e7504d7a18
@@ -2144,7 +2144,11 @@ arc_buf_fill(arc_buf_t *buf, spa_t *spa, const zbookmark_phys_t *zb,
|
||||
error = arc_fill_hdr_crypt(hdr, hash_lock, spa,
|
||||
zb, !!(flags & ARC_FILL_NOAUTH));
|
||||
if (error != 0) {
|
||||
if (hash_lock != NULL)
|
||||
mutex_enter(hash_lock);
|
||||
arc_hdr_set_flags(hdr, ARC_FLAG_IO_ERROR);
|
||||
if (hash_lock != NULL)
|
||||
mutex_exit(hash_lock);
|
||||
return (error);
|
||||
}
|
||||
}
|
||||
@@ -2247,7 +2251,11 @@ arc_buf_fill(arc_buf_t *buf, spa_t *spa, const zbookmark_phys_t *zb,
|
||||
"hdr %p, compress %d, psize %d, lsize %d",
|
||||
hdr, arc_hdr_get_compress(hdr),
|
||||
HDR_GET_PSIZE(hdr), HDR_GET_LSIZE(hdr));
|
||||
if (hash_lock != NULL)
|
||||
mutex_enter(hash_lock);
|
||||
arc_hdr_set_flags(hdr, ARC_FLAG_IO_ERROR);
|
||||
if (hash_lock != NULL)
|
||||
mutex_exit(hash_lock);
|
||||
return (SET_ERROR(EIO));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user