]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/zfs/dmu_recv.c
Fix issue in receive_object() during reallocation
[mirror_zfs.git] / module / zfs / dmu_recv.c
index 6b94047542ef87bfba435d670493687c88d0798c..0db3070978f108cfc8087e4e2d5a7bb3c4d1986a 100644 (file)
@@ -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;