openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.51k stars 1.74k forks source link

Renaming parent datasets fails with an assert error #5487

Closed pstch closed 3 years ago

pstch commented 7 years ago

System information

Type Version/Name
Distribution Name Debian GNU/Linux
Distribution Version Jessie 8.6
Linux Kernel 3.16.0
Architecture amd64
ZFS Version 0.7.0-rc2
SPL Version 0.7.0-rc2_4_gf200b83

Describe the problem you're observing

I cannot rename a parent dataset using the current Git master. The same command works fine in 0.6.5.

Describe how to reproduce the problem

zfs create -p rpool/parent/child
zfs rename rpool/parent rpool/newname

Include any warning/errors/backtraces from the system logs

root@gramsci:~# zfs rename rpool/parent rpool/newname
!clp->cl_alldependents
ASSERT at libzfs_changelist.c:474:change_one()Aborted
ilovezfs commented 7 years ago

Note that this requires a --enable-debug build.

Are you sure you didn't also set mountpoint=none? I only see this if I set mountpoint=none.

# zpool create pool1 `pwd`/pool1
# zfs create -p pool1/parent/child
# zfs rename pool1/parent pool1/newname
# zpool destroy pool1
# zpool create pool1 `pwd`/pool1
# zfs set mountpoint=none pool1
# zfs create -p pool1/parent/child
# zfs rename pool1/parent pool1/newname
!clp->cl_alldependents
ASSERT at libzfs_changelist.c:474:change_one()Aborted

This is with https://github.com/zfsonlinux/zfs/commit/3500a145952e0dfb7b7efe1c6b7856319815628c.

ilovezfs commented 7 years ago

I believe this may be a duplicate of https://github.com/zfsonlinux/zfs/issues/1836. Note that this may be a ZFS on Linux bug not an illumos bug as had been speculated in the earlier issue, given http://pastebin.com/raw/aiPv3V2j.

loli10K commented 7 years ago

The pastebin link is unfortunately dead, but i just tried with a debug build of SmartOS and i can reproduce this:

[root@52-54-00-d3-7a-01 ~]# function is_linux() {
 if [[ "$(uname)" >    if [[ "$(uname)" == "Linux" ]]; then
>       return 0
>    else
>       return 1
>    fi
> }
[root@52-54-00-d3-7a-01 ~]# #
[root@52-54-00-d3-7a-01 ~]# # setup
[root@52-54-00-d3-7a-01 ~]# POOLNAME='testpool'
[root@52-54-00-d3-7a-01 ~]# if is_linux; then
>    TMPDIR='/var/tmp'
>    mountpoint -q $TMPDIR || mount -t tmpfs tmpfs $TMPDIR
>    zpool destroy $POOLNAME
>    fallocate -l 64m $TMPDIR/zpool.dat
>    zpool create $POOLNAME $TMPDIR/zpool.dat
> else
>    TMPDIR='/tmp'
>    zpool destroy $POOLNAME
>    mkfile 64m $TMPDIR/zpool.dat
>    zpool create $POOLNAME $TMPDIR/zpool.dat
> fi
[root@52-54-00-d3-7a-01 ~]# #
[root@52-54-00-d3-7a-01 ~]# zfs set mountpoint=none $POOLNAME
[root@52-54-00-d3-7a-01 ~]# zfs create -p $POOLNAME/parent/child
[root@52-54-00-d3-7a-01 ~]# zfs rename $POOLNAME/parent $POOLNAME/newname
[root@52-54-00-d3-7a-01 ~]# zfs rename $POOLNAME/newname $POOLNAME/parent
[root@52-54-00-d3-7a-01 ~]# # debug libzfs from https://us-east.manta.joyent.com/Joyent_Dev/public/builds/platform-debug/
[root@52-54-00-d3-7a-01 ~]# LD_LIBRARY_PATH=/mnt/platform-20170514T194645Z/lib zfs rename $POOLNAME/parent $POOLNAME/newname
assertion failed for thread 0xfed82a40, thread-id 1: !clp->cl_alldependents, file ../common/libzfs_changelist.c, line 499
Abort (core dumped)
[root@52-54-00-d3-7a-01 ~]# pushd /cores/
/cores ~
[root@52-54-00-d3-7a-01 /cores]# mdb core.zfs.4160 
Loading modules: [ libumem.so.1 libc.so.1 libtopo.so.1 libnvpair.so.1 libuutil.so.1 libavl.so.1 ld.so.1 ]
> $C
08044628 libc.so.1`_lwp_kill+7(8044650, 8044650, 7a, fee4f4b9)
08044988 libc.so.1`_assfail+0x205(fed2cd1a, fed2ccfc, 1f3, fed2cd1a)
080449a8 libc.so.1`assfail+0x21(fed2cd1a, fed2ccfc, 1f3, 0)
08044e28 libzfs.so.1`change_one+0x1f9(80947c8, 809cd30, fed0bd21, 80460dc, fed30000, 80947c8)
08044e78 libzfs.so.1`iter_dependents_cb+0x1b6(80947c8, 80460dc, 8044e98, fed0bb57, fff, fef653ac)
08046068 libzfs.so.1`zfs_iter_filesystems+0xa4(8094a48, fed0bd21, 80460dc, fed0bd2f, 808cbe8, 8094c7c)
080460b8 libzfs.so.1`iter_dependents_cb+0x172(8094a48, 80460dc, 809cd30, 1b)
080460f8 libzfs.so.1`zfs_iter_dependents+0x48(8094cc8, 1, fecfb3b1, 809cd30)
08046548 libzfs.so.1`changelist_gather+0x26b(8094cc8, 1b, 0, 0, 0, 0)
08047c48 libzfs.so.1`zfs_rename+0x4cb(8094cc8, 8047e2b, 0, 0, 8047e14, 0)
08047c88 zfs_do_rename+0x223(3, 8047d14, 80778a0, 801, 0, 3)
08047cd8 main+0x22c(fed80180, feee7748, 8047d04, 8055a17, 4, 8047d10)
08047d04 _start+0x83(4, 8047e10, 8047e14, 8047e1b, 8047e2b, 0)
> ::status
debugging core file of zfs (32-bit) from 52-54-00-d3-7a-01
file: /sbin/zfs
initial argv: zfs rename testpool/parent testpool/newname
threading model: native threads
status: process terminated by SIGABRT (Abort), pid=4160 uid=0 code=-1
panic message: assertion failed for thread 0xfed82a40, thread-id 1: !clp->cl_alldependents, file ../common/libzfs_changelist.c, line 499
> 
stale[bot] commented 4 years ago

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.