https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254530

            Bug ID: 254530
           Summary: ZFS (base) receive fails to receive dataset if dataset
                    already exist
           Product: Base System
           Version: 12.2-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: b...@freebsd.org
          Reporter: pat...@hildingsson.se

This error was found while using zxfer(8) to send a zvol dataset from one
dataset to another dataset on the same pool. The dataset did not exist on the
destination prior to running zxfer.

Running the below chunk replicates the issue, at least on 12.2-RELEASE-p4
zfs create zroot/test
zfs create -o volmode=dev -V 50M zroot/test/disk0
dd if=/dev/random of=/dev/zvol/zroot/test/disk0
zfs snapshot zroot/test/disk0@test-now_ok
dd if=/dev/random of=/dev/zvol/zroot/test/disk0
zfs snapshot zroot/test/disk0@test-now_ok-2
dd if=/dev/random of=/dev/zvol/zroot/test/disk0
zfs create -V 52428800 -o 'reservation=none' -o 'volblocksize=8192' -o
'checksum=on' -o 'compression=lz4' -o 'readonly=off' -o 'copies=1' -o
'logbias=throughput' -o 'dedup=off' -o 'sync=standard' -o 'volmode=dev' -o
'snapshot_limit=none' -o 'redundant_metadata=most' zroot/test/disk1
zfs send zroot/test/disk0@test-now_ok | zfs receive -F zroot/test/disk1


At your convenience I have copy/pasted the above commands and the resulting
error:
# zfs create zroot/test
# zfs create -o volmode=dev -V 50M zroot/test/disk0
# dd if=/dev/random of=/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.552508 secs (94892325 bytes/sec)
# zfs snapshot zroot/test/disk0@test-now_ok
# dd if=/dev/random of=/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.507651 secs (103277323 bytes/sec)
# zfs snapshot zroot/test/disk0@test-now_ok-2
# dd if=/dev/random of=/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.515789 secs (101647735 bytes/sec)
# zfs create -V 52428800 -o 'reservation=none' -o 'volblocksize=8192' -o
'checksum=on' -o 'compression=lz4' -o 'readonly=off' -o 'copies=1' -o
'logbias=throughput' -o 'dedup=off' -o 'sync=standard' -o 'volmode=dev' -o
'snapshot_limit=none' -o 'redundant_metadata=most' zroot/test/disk1
root@lrrr:~ # zfs send zroot/test/disk0@test-now_ok | zfs receive -F
zroot/test/disk1
cannot open 'zroot/test/disk1/': trailing slash in name
warning: cannot send 'zroot/test/disk0@test-now_ok': signal received


# zfs send zroot/test/disk0@test-now_ok | zstreamdump
BEGIN record
        hdrtype = 1
        features = 0
        magic = 2f5bacbac
        creation_time = 605ba746
        type = 3
        flags = 0x4
        toguid = f1d16456c4cc9f82
        fromguid = 0
        toname = zroot/test/disk0@test-now_ok
END checksum =
64c114cf9127fc/5e00770266493cb3/7fb09ad1733d83d9/9fc28d91b9886732
SUMMARY:
        Total DRR_BEGIN records = 1
        Total DRR_END records = 1
        Total DRR_OBJECT records = 2
        Total DRR_FREEOBJECTS records = 4
        Total DRR_WRITE records = 6401
        Total DRR_WRITE_BYREF records = 0
        Total DRR_WRITE_EMBEDDED records = 0
        Total DRR_FREE records = 4
        Total DRR_SPILL records = 0
        Total records = 6413
        Total write size = 52429312 (0x3200200)
        Total stream length = 54430168 (0x33e89d8)

However the error never appears if zfs receive is run without in advance
creating the dataset on the destination, as can be seen below:

# zfs create zroot/test
# zfs create -o volmode=dev -V 50M zroot/test/disk0
# dd if=/dev/random of=/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 1.084470 secs (48345071 bytes/sec)
# zfs snapshot zroot/test/disk0@test-now_ok
# dd if=/dev/random of=/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.627445 secs (83559234 bytes/sec)
# zfs snapshot zroot/test/disk0@test-now_ok-2
# dd if=/dev/random of=/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.512001 secs (102399789 bytes/sec)
# zfs send zroot/test/disk0@test-now_ok | zfs receive -F zroot/test/disk1
# echo $?
0

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to