Page MenuHomeFreeBSD

unionfs: lock newly-created vnodes before calling insmntque()
ClosedPublic

Authored by jah on Sep 12 2021, 5:52 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 30, 4:38 AM
Unknown Object (File)
Mar 8 2024, 12:04 AM
Unknown Object (File)
Feb 15 2024, 4:18 AM
Unknown Object (File)
Feb 15 2024, 4:18 AM
Unknown Object (File)
Dec 29 2023, 2:33 PM
Unknown Object (File)
Dec 20 2023, 3:08 AM
Unknown Object (File)
Dec 13 2023, 6:18 AM
Unknown Object (File)
Nov 29 2023, 8:55 AM
Subscribers

Details

Summary

This fixes an insta-panic when attempting to use unionfs with
DEBUG_VFS_LOCKS.

Diff Detail

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

Event Timeline

jah requested review of this revision.Sep 12 2021, 5:52 AM
This revision is now accepted and ready to land.Sep 12 2021, 12:22 PM

Also free the vnode cache hashtable

This revision now requires review to proceed.Sep 19 2021, 10:36 PM

Remove unintentionally added line from a different commit

This revision is now accepted and ready to land.Sep 19 2021, 10:50 PM

I got this with a NON-DIAGNOSTIC build:

20210920 09:54:32 all (4/5): unionfs4.sh
panic: ufs dir vp 0xfffffe01494f5258 ip 0xfffff80561d75d80 flags 0x3c0e
cpuid = 7
time = 1632124475
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe014165b670
vpanic() at vpanic+0x187/frame 0xfffffe014165b6d0
panic() at panic+0x43/frame 0xfffffe014165b730
ffs_getpages() at ffs_getpages/frame 0xfffffe014165b760
unionfs_unlock() at unionfs_unlock+0xa8/frame 0xfffffe014165b7a0
vput() at vput+0x69/frame 0xfffffe014165b7d0
vop_stdvput_pair() at vop_stdvput_pair+0x17/frame 0xfffffe014165b7f0
vn_open_cred() at vn_open_cred+0x3a4/frame 0xfffffe014165b960
kern_openat() at kern_openat+0x28c/frame 0xfffffe014165bac0
amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe014165bbf0
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe014165bbf0
--- syscall (499, FreeBSD ELF64, sys_openat), rip = 0x8011a8c1a, rsp = 0x7fffffffe1b8, rbp = 0x7fffffffe2a0 ---

https://people.freebsd.org/~pho/stress/log/log0177.txt

In D31917#722640, @pho wrote:

I got this with a NON-DIAGNOSTIC build:
https://people.freebsd.org/~pho/stress/log/log0177.txt

This issue is clearly due to the lack of the proper implementation of VOP_VPUT_PAIR() for unionfs. It should be similar, but more complicated, to nullfs vput_pair().