]> granicus.if.org Git - zfs/commit
Fix dsl_scan_ds_clone_swapped logic
authorAndriy Gapon <avg@FreeBSD.org>
Wed, 18 Sep 2019 16:04:45 +0000 (19:04 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 18 Sep 2019 16:04:45 +0000 (09:04 -0700)
commitdd262c9681793e2bae6528297803e627622801f0
tree79335dfe72d4fe70d61910847ed5f3e65c9758ae
parentfcd37b622b9fb3a9673b483c59fb2d1a8c368177
Fix dsl_scan_ds_clone_swapped logic

The was incorrect with respect to swapping dataset IDs both in the
on-disk ZAP object and the in-memory queue.

In both cases, if ds1 was already present, then it would be first
replaced with ds2 and then ds would be replaced back with ds1.
Also, both cases did not properly handle a situation where both ds1 and
ds2 are already queued.  A duplicate insertion would be attempted and
its failure would result in a panic.

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Andriy Gapon <avg@FreeBSD.org>
Closes #9140
Closes #9163
module/zfs/dsl_scan.c