mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fix issue in receive_object() during reallocation
When receiving an object to a previously allocated interior slot the new object should be "allocated" by setting DMU_NEW_OBJECT, not "reallocated" with dnode_reallocate(). For resilience verify the slot is free as required in case the stream is malformed. Add a test case to generate more realistic incremental send streams that force reallocation to occur during the receive. Reviewed-by: Olaf Faaland <faaland1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #8067 Closes #8614
This commit is contained in:
@@ -1253,7 +1253,12 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
|
||||
* earlier in the stream.
|
||||
*/
|
||||
txg_wait_synced(dmu_objset_pool(rwa->os), 0);
|
||||
object = drro->drr_object;
|
||||
|
||||
if (dmu_object_info(rwa->os, drro->drr_object, NULL) != ENOENT)
|
||||
return (SET_ERROR(EINVAL));
|
||||
|
||||
/* object was freed and we are about to allocate a new one */
|
||||
object = DMU_NEW_OBJECT;
|
||||
} else {
|
||||
/* object is free and we are about to allocate a new one */
|
||||
object = DMU_NEW_OBJECT;
|
||||
|
||||
Reference in New Issue
Block a user