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)
Mon, Nov 25, 3:25 PM
Unknown Object (File)
Sun, Nov 24, 5:56 PM
Unknown Object (File)
Fri, Nov 22, 9:22 PM
Unknown Object (File)
Fri, Nov 22, 1:27 PM
Unknown Object (File)
Fri, Nov 22, 12:08 PM
Unknown Object (File)
Tue, Nov 12, 12:28 AM
Unknown Object (File)
Mon, Nov 11, 10:02 PM
Unknown Object (File)
Mon, Nov 11, 7:44 PM
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().