Project

General

Profile

Bug #755

dmu_recv_stream builds incomplete guid_to_ds_map

Added by Alexander Stetsenko over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
High
Category:
kernel
Start date:
2011-02-27
Due date:
% Done:

100%

Estimated time:
Difficulty:
Tags:

Description

This issue was discovered by Anatoliy Legkodymov on nexentastor and
reproduces on Illumos as well.
Bug was in zfs code that received deduplicated stream -
when deduplicated block is arrived it requires entry
in guid_to_ds_map (that maps guid to dsl_dataset_t) in case that block refers on dataset (snapshot) with different guid.
Buggy zfs_recv_stream code did build guid_to_ds_map
only once (before first substream was recieved) by traversing existing datasets, but in fact in that time no received (and required) datasets existed.
As result "restore_write_byref" code was unable to find
dataset (snapshot) with guid it referred to.

Fix: one need to add each of received datasets to guid_to_ds_map.

Minimal steps to reproduce:

mkfile 64m /tmp/data.file
mkfile 64m /tmp/backup.file
zpool create data /tmp/data.file
zpool create backup /tmp/backup.file
zfs create data/a
zfs create data/a/b
zfs snapshot -r data/a@C
zfs destroy -r data/a/b
zfs snapshot data/a@D
zfs send -vpRD data/a@D | zfs receive -dFeu backup
sending from @ to data/a@C
sending from @C to data/a@D
cannot receive incremental stream: invalid backup stream

History

#1

Updated by Alexander Stetsenko over 8 years ago

  • % Done changed from 0 to 10
#2

Updated by Alexander Stetsenko over 8 years ago

  • Status changed from New to In Progress
#3

Updated by Alexander Stetsenko over 8 years ago

  • Category set to kernel
  • % Done changed from 10 to 90

generated dedup stream is ok.
zfs recv fails because of dmu_recv_stream builds incomplete guid_to_ds map.

#4

Updated by Alexander Stetsenko over 8 years ago

  • Subject changed from zfs send -D generates invalid backup stream to dmu_recv_stream builds incomplete guid_to_ds_map
#5

Updated by Alexander Stetsenko over 8 years ago

  • % Done changed from 90 to 100
#6

Updated by Alexander Stetsenko over 8 years ago

  • Status changed from In Progress to Resolved

Resolved in

changeset: 13329:c48b8bf84ab7
user: Alexander Stetsenko <>
date: Fri Apr 08 14:39:40 2011 -0400
description:
755 dmu_recv_stream builds incomplete guid_to_ds_map
Reviewed by: Matthew Ahrens <>
Reviewed by: Garrett D`Amore <>
Reviewed by: Gordon Ross <>
Approved by: Gordon Ross <>

Fix: add every snapshot from the received dedup stream into guid_to_ds_map

Also available in: Atom PDF