From nobody Sat Jul 31 18:05:23 2021 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EDC2912B0AA3 for ; Sat, 31 Jul 2021 18:05:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GcXHR62Lsz4ncY for ; Sat, 31 Jul 2021 18:05:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B42861D1C2 for ; Sat, 31 Jul 2021 18:05:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 16VI5NTw051806 for ; Sat, 31 Jul 2021 18:05:23 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 16VI5N7Y051805 for bugs@FreeBSD.org; Sat, 31 Jul 2021 18:05:23 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 257522] msdosfs rename(2) deadlock Date: Sat, 31 Jul 2021 18:05:23 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: trasz@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257522 Bug ID: 257522 Summary: msdosfs rename(2) deadlock Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: trasz@FreeBSD.org The script below, when run twice in parallel, immediately deadlocks 14-CURR= ENT: #!/bin/sh while :; do mkdir a mv a b rmdir b done There are two locked vnodes, 0xfffff800be0d9000, locked by tid 101332, and 0xfffff8000818331c0, locked by tid 101333. Backtraces: (kgdb) thread 637 [Switching to thread 637 (Thread 101332)] #0 sched_switch (td=3Dtd@entry=3D0xfffffe00d03da000, flags=3D, flags@entry=3D260) at /usr/home/trasz/git/freebsd/sys/kern/sched_ule.c:2097 2097 cpuid =3D td->td_oncpu =3D PCPU_GET(cpuid); (kgdb) bt #0 sched_switch (td=3Dtd@entry=3D0xfffffe00d03da000, flags=3D, flags@entry=3D260) at /usr/home/trasz/git/freebsd/sys/kern/sched_ule.c:2097 #1 0xffffffff80c2e315 in mi_switch (flags=3Dflags@entry=3D260) at /usr/home/trasz/git/freebsd/sys/kern/kern_synch.c:540 #2 0xffffffff80c7edd9 in sleepq_switch (wchan=3D0xfffff80081833230, wchan@entry=3D0xffffffff812567fc, pri=3Dpri@entry=3D96) at /usr/home/trasz/git/freebsd/sys/kern/subr_sleepqueue.c:608 #3 0xffffffff80c7ec9e in sleepq_wait (wchan=3D, pri=3D) at /usr/home/trasz/git/freebsd/sys/kern/subr_sleepqueue.c:659 #4 0xffffffff80bf3110 in sleeplk (lk=3Dlk@entry=3D0xfffff80081833230, flags=3Dflags@entry=3D532480, ilk=3D, ilk@entry=3D0xfffff800= 81833258, wmesg=3D, wmesg@entry=3D0xffffffff812567fc "msdosfs", pri=3D, pri@entr= y=3D96, timo=3D51, timo@entry=3D532480, queue=3D0) at /usr/home/trasz/git/freebsd/sys/kern/kern_lock.c:310 #5 0xffffffff80bf1602 in lockmgr_xlock_hard (lk=3D0xfffff80081833230, flags=3D, ilk=3D, file=3D, line=3D= 3009, lwa=3D) at /usr/home/trasz/git/freebsd/sys/kern/kern_lock.c:940 #6 0xffffffff811ae37c in VOP_LOCK1_APV (vop=3D0xffffffff81aef040 , a=3Da@entry=3D0xfffffe00d07fc5d8) at vnode_if.c:2247 #7 0xffffffff80d26a24 in VOP_LOCK1 (vp=3D0xfffff800818331c0, flags=3D53248= 0, file=3D0xffffffff811dffc9 "/usr/home/trasz/git/freebsd/sys/kern/vfs_subr.c", line=3D3009) at ./vnode_if.h:1131 #8 _vn_lock (vp=3Dvp@entry=3D0xfffff800818331c0, flags=3Dflags@entry=3D532= 480, file=3D0xffffffff811dffc9 "/usr/home/trasz/git/freebsd/sys/kern/vfs_subr.c", line=3Dline@entry=3D3009) at /usr/home/trasz/git/freebsd/sys/kern/vfs_vnops.c:1805 #9 0xffffffff80d0e6fa in vget_finish (vp=3D0xfffff800818331c0, flags=3D532= 480, vs=3Dvs@entry=3DVGET_USECOUNT) at /usr/home/trasz/git/freebsd/sys/kern/vfs_subr.c:3009 #10 0xffffffff80cea40e in cache_lookup (dvp=3D, dvp@entry=3D0xfffff800be0d9000, vpp=3D, vpp@entry=3D0xfffffe00d07fc8d8, cnp=3D, cnp@entry=3D0xfffffe00d07fc900, tsp=3Dtsp@entry=3D0x0, ticksp=3D, ticksp@entry=3D0x0) at /usr/home/trasz/git/freebsd/sys/kern/vfs_cache.c:2096 #11 0xffffffff80ceefab in vfs_cache_lookup (ap=3D) at /usr/home/trasz/git/freebsd/sys/kern/vfs_cache.c:3063 #12 0xffffffff811aab7a in VOP_LOOKUP_APV (vop=3D0xffffffff81aef040 , a=3Da@entry=3D0xfffffe00d07fc770) at vnode_if.c:117 #13 0xffffffff80cffbc1 in VOP_LOOKUP (dvp=3D0xfffff800be0d9000, vpp=3D0xfffffe00d07fc8d8, cnp=3D0xfffffe00d07fc900) at ./vnode_if.h:69 #14 lookup (ndp=3Dndp@entry=3D0xfffffe00d07fc880) at /usr/home/trasz/git/freebsd/sys/kern/vfs_lookup.c:1131 #15 0xffffffff80cfe9f9 in namei (ndp=3Dndp@entry=3D0xfffffe00d07fc880) at /usr/home/trasz/git/freebsd/sys/kern/vfs_lookup.c:661 #16 0xffffffff80d1f0ed in kern_statat (td=3D0xfffffe00d03da000, td@entry=3D, flag=3D, fd=3D-100, path=3D0x7fffffffe835 , pathseg=3Dpathseg@entry=3DUIO_USERSPACE, sbp=3Dsbp@entry=3D0xfffffe00d07fc9= d8, hook=3D0x0) at /usr/home/trasz/git/freebsd/sys/kern/vfs_syscalls.c:2441 #17 0xffffffff80d1f7df in sys_fstatat (td=3D, td@entry=3D, uap=3D0xfffffe00d03da3e8, uap@entry=3D) at /usr/home/trasz/git/freebsd/sys/kern/vfs_syscalls.c:2418 #18 0xffffffff810e4b0e in syscallenter (td=3D) at /usr/home/trasz/git/freebsd/sys/amd64/amd64/../../kern/subr_syscall.c:189 #19 amd64_syscall (td=3D0xfffffe00d03da000, traced=3D0) at /usr/home/trasz/git/freebsd/sys/amd64/amd64/trap.c:1186 (kgdb) thread 636 [Switching to thread 636 (Thread 101333)] #0 sched_switch (td=3Dtd@entry=3D0xfffffe00d057f3a0, flags=3D, flags@entry=3D260) at /usr/home/trasz/git/freebsd/sys/kern/sched_ule.c:2097 2097 cpuid =3D td->td_oncpu =3D PCPU_GET(cpuid); (kgdb) bt #0 sched_switch (td=3Dtd@entry=3D0xfffffe00d057f3a0, flags=3D, flags@entry=3D260) at /usr/home/trasz/git/freebsd/sys/kern/sched_ule.c:2097 #1 0xffffffff80c2e315 in mi_switch (flags=3Dflags@entry=3D260) at /usr/home/trasz/git/freebsd/sys/kern/kern_synch.c:540 #2 0xffffffff80c7edd9 in sleepq_switch (wchan=3D0xfffff800be0d9070, wchan@entry=3D0xffffffff812567fc, pri=3Dpri@entry=3D96) at /usr/home/trasz/git/freebsd/sys/kern/subr_sleepqueue.c:608 #3 0xffffffff80c7ec9e in sleepq_wait (wchan=3D, pri=3D) at /usr/home/trasz/git/freebsd/sys/kern/subr_sleepqueue.c:659 #4 0xffffffff80bf3110 in sleeplk (lk=3Dlk@entry=3D0xfffff800be0d9070, flags=3Dflags@entry=3D525312, ilk=3D, ilk@entry=3D0xfffff800= be0d9098, wmesg=3D, wmesg@entry=3D0xffffffff812567fc "msdosfs", pri=3D, pri@entr= y=3D96, timo=3D51, timo@entry=3D525312, queue=3D0) at /usr/home/trasz/git/freebsd/sys/kern/kern_lock.c:310 #5 0xffffffff80bf1602 in lockmgr_xlock_hard (lk=3D0xfffff800be0d9070, flags=3D, ilk=3D, file=3D, line=3D= 1411, lwa=3D) at /usr/home/trasz/git/freebsd/sys/kern/kern_lock.c:940 #6 0xffffffff811ae37c in VOP_LOCK1_APV (vop=3D0xffffffff81aef040 , a=3Da@entry=3D0xfffffe00d0ecd698) at vnode_if.c:2247 #7 0xffffffff80d26a24 in VOP_LOCK1 (vp=3D0xfffff800be0d9000, flags=3D52531= 2, file=3D0xffffffff81293608 "/usr/home/trasz/git/freebsd/sys/kern/vfs_lookup.= c", line=3D1411) at ./vnode_if.h:1131 #8 _vn_lock (vp=3D0xfffff800be0d9000, flags=3Dflags@entry=3D525312, file=3D0xffffffff81293608 "/usr/home/trasz/git/freebsd/sys/kern/vfs_lookup.= c", line=3Dline@entry=3D1411) at /usr/home/trasz/git/freebsd/sys/kern/vfs_vnops.c:1805 #9 0xffffffff80d0093f in relookup (dvp=3D0xfffff800be0d9000, vpp=3Dvpp@entry=3D0xfffffe00d0ecd820, cnp=3D0xfffffe00d0ecd9e0) at /usr/home/trasz/git/freebsd/sys/kern/vfs_lookup.c:1411 #10 0xffffffff80ac3065 in msdosfs_rename (ap=3D0xfffffe00d0ecda38) at /usr/home/trasz/git/freebsd/sys/fs/msdosfs/msdosfs_vnops.c:1115 #11 0xffffffff811ad4ac in VOP_RENAME_APV (vop=3D0xffffffff81aef040 , a=3Da@entry=3D0xfffffe00d0ecda38) at vnode_if.c:1678 #12 0xffffffff80d2276d in VOP_RENAME (fdvp=3D, fvp=3D, fcnp=3D, tdvp=3D, tvp=3D, tcnp= =3D) at ./vnode_if.h:863 #13 kern_renameat (td=3D0xfffffe00d057f3a0, td@entry=3D, oldfd=3D-100, oldfd@entry=3D, old=3D0x7fffffffe833 , old@entry=3D, newfd=3D-100, newfd@entry=3D, new=3D0x7fffffffde70 , new@entry=3D, pathseg=3D, pathseg@entry=3D) at /usr/home/trasz/git/freebsd/sys/kern/vfs_syscalls.c:3743 #14 0xffffffff810e4b0e in syscallenter (td=3D) at /usr/home/trasz/git/freebsd/sys/amd64/amd64/../../kern/subr_syscall.c:189 #15 amd64_syscall (td=3D0xfffffe00d057f3a0, traced=3D0) at /usr/home/trasz/git/freebsd/sys/amd64/amd64/trap.c:1186 The kernel is amd64 FreeBSD 14-CURRENT, with "pragma clang optimize off" ad= ded to msdosfs_vnops.c, and DEBUG_VFS_LOCKS option added (also happens without = it; there are no additional locking warnings). --=20 You are receiving this mail because: You are the assignee for the bug.=