Reviewed by: John Kennedy <[email protected]>
Reviewed by: Matt Ahrens <[email protected]>

Datasets that are deeply nested (~100 levels) are impractical. We just put a
limit of 50 levels to newly created datasets. Existing datasets should work
without a problem.

The problem can be seen by attempting to create a dataset using the -p option 
with this many levels:
testpool/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a

panic[cpu0]/thread=ffffff01cd282c20: BAD TRAP: type=8 (#df Double fault) 
rp=fffffffffbc3ab80 addr=0

zfs: #df Double fault
pid=4792, pc=0xfffffffff79bd1aa, sp=0xffffff00083d7000, eflags=0x10296
cr0: 80050033<pg,wp,ne,et,mp,pe> cr4: 6b8<xmme,fxsr,pge,pae,pse,de>
cr2: ffffff00083d6ff8cr3: 139ca3000cr8: c

rdi: ffffff01e2f4b0a0 rsi: ffffffffffffffff rdx: ffffff01cd282c20
        rcx:                6  r8: ffffff01e2f0cc80  r9: fffffffff79d4250
        rax:                0 rbx:             522b rbp: ffffff00083d7020
        r10: ffffff01c5026848 r11: ffffff01c9cbcef0 r12: ffffff01e2f4b038
        r13: ffffff01dae5f4c0 r14: ffffff01cb2a8000 r15:                0
        fsb:                0 gsb: fffffffffbc30520  ds:               4b
         es:               4b  fs:                0  gs:              1c3
        trp:                8 err:                0 rip: fffffffff79bd1aa
         cs:               30 rfl:            10296 rsp: ffffff00083d7000
         ss:               38
tss.tss_rsp0:   0xffffff00083dc000
tss.tss_rsp1:   0x0
tss.tss_rsp2:   0x0
tss.tss_ist1:   0xfffffffffbc3ac70
tss.tss_ist2:   0x0
tss.tss_ist3:   0x0
tss.tss_ist4:   0x0
tss.tss_ist5:   0x0
tss.tss_ist6:   0x0
tss.tss_ist7:   0x0
fffffffffbc3aa60 unix:die+100 ()
fffffffffbc3ab70 unix:trap+157d ()
ffffff00083d7020 unix:_patch_xrstorq_rbx+196 ()
ffffff00083d7050 zfs:dbuf_rele+2e ()
...
ffffff00083d7080 zfs:dsl_dir_close+32 ()
ffffff00083d70b0 zfs:dsl_dir_evict+30 ()
ffffff00083d70d0 zfs:dbuf_evict_user+4a ()
ffffff00083d7100 zfs:dbuf_rele_and_unlock+87 ()
ffffff00083d7130 zfs:dbuf_rele+2e ()
... The block above repeats once per directory in the ...
... create -p command, working towards the root ...
ffffff00083db9f0 zfs:dsl_dataset_drop_ref+19 ()
ffffff00083dba20 zfs:dsl_dataset_rele+42 ()
ffffff00083dba70 zfs:dmu_objset_prefetch+e4 ()
ffffff00083dbaa0 zfs:findfunc+23 ()
ffffff00083dbb80 zfs:dmu_objset_find_spa+38c ()
ffffff00083dbbc0 zfs:dmu_objset_find+40 ()
ffffff00083dbc20 zfs:zfs_ioc_snapshot_list_next+4b ()
ffffff00083dbcc0 zfs:zfsdev_ioctl+347 ()
ffffff00083dbd00 genunix:cdev_ioctl+45 ()
ffffff00083dbd40 specfs:spec_ioctl+5a ()
ffffff00083dbdc0 genunix:fop_ioctl+7b ()
ffffff00083dbec0 genunix:ioctl+18e ()
ffffff00083dbf10 unix:brand_sys_sysenter+1c9 ()

Upstream bug: DLPX-18213
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * 9330 stack overflow when creating a deeply nested dataset

-- File Changes --

    M usr/src/cmd/mdb/common/modules/zfs/zfs.c (1)
    M usr/src/common/zfs/zfs_namecheck.c (67)
    M usr/src/common/zfs/zfs_namecheck.h (6)
    M usr/src/lib/libzfs/common/libzfs_dataset.c (21)
    M usr/src/man/man1m/zfs.1m (3)
    M usr/src/pkg/manifests/system-test-zfstest.mf (3)
    M usr/src/test/zfs-tests/runfiles/delphix.run (2)
    M usr/src/test/zfs-tests/runfiles/omnios.run (2)
    M usr/src/test/zfs-tests/runfiles/openindiana.run (2)
    M 
usr/src/test/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create.cfg (8)
    M 
usr/src/test/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_009_neg.ksh
 (3)
    A 
usr/src/test/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_014_neg.ksh
 (110)
    M usr/src/uts/common/fs/zfs/dmu_objset.c (4)
    M usr/src/uts/common/fs/zfs/dsl_dir.c (31)

-- Patch Links --

https://github.com/openzfs/openzfs/pull/598.patch
https://github.com/openzfs/openzfs/pull/598.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/598

------------------------------------------
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/discussions/T0d3234f0c2ad9adc-M9cc1ed11c9c491ceed1d3332
Delivery options: https://openzfs.topicbox.com/groups

Reply via email to