Page MenuHomeFreeBSD

zfs: don't verify recycled vnode for zfs control directory
AbandonedPublic

Authored by rew on Feb 16 2023, 9:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 10 2024, 6:40 PM
Unknown Object (File)
Jan 2 2024, 7:45 PM
Unknown Object (File)
Dec 22 2023, 11:10 PM
Unknown Object (File)
Sep 25 2023, 5:55 PM
Unknown Object (File)
Jun 24 2023, 8:36 AM
Unknown Object (File)
Jun 24 2023, 5:55 AM
Unknown Object (File)
Jun 6 2023, 9:19 PM
Unknown Object (File)
Mar 19 2023, 3:49 PM
Subscribers

Details

Reviewers
None
Summary

I don't intend to commit this patch to FreeBSD but wanted to seek
feedback here before submitting a PR to OpenZFS.

Under certain loads, the following panic is hit:

panic: VERIFY3(vrecycle(vp) == 1) failed (0 == 1)
cpuid = 17
KDB: stack backtrace:
#0 0xffffffff805e29c5 at kdb_backtrace+0x65
#1 0xffffffff8059620f at vpanic+0x17f
#2 0xffffffff81a27f4a at spl_panic+0x3a
#3 0xffffffff81a3a4d0 at zfsctl_snapshot_inactive+0x40
#4 0xffffffff8066fdee at vinactivef+0xde
#5 0xffffffff80670b8a at vgonel+0x1ea
#6 0xffffffff806711e1 at vgone+0x31
#7 0xffffffff8065fa0d at vfs_hash_insert+0x26d
#8 0xffffffff81a39069 at sfs_vgetx+0x149
#9 0xffffffff81a39c54 at zfsctl_snapdir_lookup+0x1e4
#10 0xffffffff80661c2c at lookup+0x45c
#11 0xffffffff80660e59 at namei+0x259
#12 0xffffffff8067e3d3 at kern_statat+0xf3
#13 0xffffffff8067eacf at sys_fstatat+0x2f
#14 0xffffffff808b5ecc at amd64_syscall+0x10c
#15 0xffffffff8088f07b at fast_syscall_common+0xf8

This is a race condition that occurs between allocating a new vnode
and adding that vnode to the vfs hash. If the newly created vnode loses
the race when being inserted into the vfs hash, it will not be recycled
as its usecount is greater than zero, hitting the above assertion.

Fix this by dropping the assertion.

PR: 252700
Sponsored-by: rsync.net
Sponsored-by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49860
Build 46751: arc lint + arc unit