Page MenuHomeFreeBSD

Fix ZFS ztest(1) dies through failed assertion
Needs ReviewPublic

Authored by sevan on Dec 8 2018, 7:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 4:44 AM
Unknown Object (File)
Sat, Apr 13, 1:24 AM
Unknown Object (File)
Jan 15 2024, 3:36 PM
Unknown Object (File)
Dec 20 2023, 4:07 AM
Unknown Object (File)
Dec 3 2023, 11:08 PM
Unknown Object (File)
Sep 20 2023, 4:50 PM
Unknown Object (File)
Aug 24 2023, 11:25 PM
Unknown Object (File)
Jul 6 2023, 2:46 AM
Subscribers

Details

Reviewers
None
Group Reviewers
ZFS
Summary

Bug 228797
Apply change to ztest.c from openzfs repo from[1]
This allows ztest to run through a default 5 min run without fail on FreeBSD 12.0-rc2.
ztest artifacts in /tmp (default location) should be removed between comparing patched & unpatched version for validation.

[1] 5408 managing ZFS cache devices requires lots of RAM
https://github.com/openzfs/openzfs/commit/89c86e32293a30cdd7af530c38b2073fee01411c

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 21448
Build 20769: arc lint + arc unit

Event Timeline

Unfortunately not

#0  thr_kill () at thr_kill.S:3
#1  0x00000008007a1844 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
#2  0x0000000800714079 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x0000000800499c47 in arc_hdr_alloc (spa=<optimized out>, psize=<optimized out>, lsize=<optimized out>, compression_type=ZIO_COMPRESS_OFF, type=ARC_BUFC_DATA)
    at /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:3412
#4  0x000000080049902f in arc_alloc_buf (spa=<optimized out>, tag=0x8002cf27d, type=1488816720, size=256) at /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:3528
#5  0x0000000800498f51 in arc_loan_buf (spa=0x188c4, is_metadata=<optimized out>, size=8008826) at /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:3044
#6  0x000000000020ff70 in ztest_dmu_read_write_zcopy (zd=<optimized out>, id=<optimized out>) at /usr/src/cddl/contrib/opensolaris/cmd/ztest/ztest.c:4187
#7  0x000000000021fd3a in ztest_execute (zi=0x222118 <ztest_info+216>, test=<optimized out>, id=<optimized out>) at /usr/src/cddl/contrib/opensolaris/cmd/ztest/ztest.c:5933
#8  ztest_thread (arg=0xc) at /usr/src/cddl/contrib/opensolaris/cmd/ztest/ztest.c:5981
#9  0x00000008005d1776 in thread_start (curthread=0x8057d6f00) at /usr/src/lib/libthr/thread/thr_create.c:292
#10 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffa7238000

Stock unpatched binary was in $PATH and would get executed by the patched master process.
Apologies for the noise.

I would check the chunksize at the beginning of the function and pick a new random value if the current value is less than SPA_MINBLOCKSIZE * 2.
There could also be a comment explaining why that is done.
Adding four individual checks rather than a single one seems to be suboptimal.