Only filesystems and volumes are valid 'zfs remap' parameters: when passed a 
snapshot name zfs_remap_indirects() does not handle the EINVAL returned from 
libzfs_core, which results in failing an assertion and consequently crashing.

```
loli@openindiana:~$ uname -a
SunOS openindiana 5.11 master-0-g862ff6d99c i86pc i386 i86pc
loli@openindiana:~$ zpool list testpool
NAME       SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
testpool   112M    86K   112M         -     0%     0%  1.00x  ONLINE  -
loli@openindiana:~$ sudo zfs remap testpool@snap
internal error: Invalid argument
Abort
loli@openindiana:~$ sudo mdb core
Loading modules: [ libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1 
libnvpair.so.1 ld.so.1 ]
> ::obey
No Language H here
> $C     
08047828 libc.so.1`_lwp_kill+0x15(1, 6, 8f, fef47000, fef47000, 80ed4f0)
08047848 libc.so.1`raise+0x2b(6, 0, 8047860, fee8942b, 0, 0)
08047898 libc.so.1`abort+0x10e(8078120, fedafb02, 80ed4f0, 804791c, 80478d8, 
fedc1000)
080478c8 libzfs.so.1`zfs_verror+0x96(80ed0c8, 818, fedae3df, 804791c, 80ed0c8, 
feed9b1d)
08047908 libzfs.so.1`zfs_standard_error_fmt+0x1b5(80ed0c8, 16, fedae3df, 
8047940)
08047928 libzfs.so.1`zfs_standard_error+0x28(80ed0c8, 16, 8047940, feca0ba4)
08047d48 libzfs.so.1`zfs_remap_indirects+0x65(80ed0c8, 8047eca, 2d, 8047df8)
08047d68 zfs_do_remap+0x4a(2, 8047dfc, 80778e0, 801, 0, 3)
08047db8 main+0x22c(8047dac, fef54328, 8047dec, 8055d1b, 3, 8047df8)
08047dec _start+0x83(3, 8047ec0, 8047ec4, 8047eca, 0, 8047ed8)
```

Illumos issue: https://www.illumos.org/issues/9512
ZFSonLinux commit 
https://github.com/zfsonlinux/zfs/commit/b4555c777a0be3c0dba29662d278c57099c60a87.
You can view, comment on, or merge this pull request online at:

  https://github.com/openzfs/openzfs/pull/633

-- Commit Summary --

  * 9512 zfs remap poolname@snapname dumps core

-- File Changes --

    M usr/src/cmd/zfs/zfs_main.c (17)
    M usr/src/lib/libzfs/common/libzfs_dataset.c (16)
    M usr/src/pkg/manifests/system-test-zfstest.mf (8)
    M usr/src/test/zfs-tests/runfiles/delphix.run (3)
    M usr/src/test/zfs-tests/runfiles/omnios.run (3)
    M usr/src/test/zfs-tests/runfiles/openindiana.run (3)
    A usr/src/test/zfs-tests/tests/functional/cli_root/zfs_remap/Makefile (21)
    A usr/src/test/zfs-tests/tests/functional/cli_root/zfs_remap/cleanup.ksh 
(19)
    A usr/src/test/zfs-tests/tests/functional/cli_root/zfs_remap/setup.ksh (17)
    A 
usr/src/test/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_cliargs.ksh
 (78)
    A 
usr/src/test/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_obsolete_counts.ksh
 (76)

-- Patch Links --

https://github.com/openzfs/openzfs/pull/633.patch
https://github.com/openzfs/openzfs/pull/633.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/633

------------------------------------------
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/discussions/T3b5605138f9abe5d-Maaa5dcf284f3b54fb2e33c57
Delivery options: https://openzfs.topicbox.com/groups

Reply via email to