On Sun, Jun 3, 2018 at 9:08 AM, Theo de Raadt <dera...@openbsd.org> wrote:
> Philip Guenther <guent...@gmail.com> wrote: > > > On Sun, Jun 3, 2018 at 3:26 AM, Klemens Nanni <k...@openbsd.org> wrote: > > > > > Snap from 31.05.2018 with > > > > > > OpenBSD 6.3-current (GENERIC.MP) #0: Sat Jun 2 16:21:22 CEST 2018 > > > k...@x250.my.domain:/usr/src/sys/arch/amd64/compile/GENERIC.MP > > > > > > > > > acquiring duplicate lock of same type: "&mp->mnt_lock" > > > 1st vfslock @ /usr/src/sys/kern/vfs_subr.c:191 > > > 2nd vfslock @ /usr/src/sys/kern/vfs_subr.c:191 > > > Starting stack trace... > > > witness_checkorder(9,ffffffff81ab15c8,bf,ffff800000d00040,21) at > > > witness_checkorder+0x63d > > > _rw_enter(0,1,0,ffff800000d00000) at _rw_enter+0x56 > > > vfs_stall(1,ffff800000025400) at vfs_stall+0xab > > > > > > > [Also reported by bluhm@ and others] > > > > Is vfs_stall() the only place that locks (busies) multiple mounts? > > Isn't that also how unmount works? I believe it locks the mount it will > be discarding, and the filesystem it is mounted upon. It is serializing > against other activities, such as a new mount or another umount occuring > against the same dir. <cleans glasses> Hmm, yes, dounmount() can busy multiple filesystems concurrently when doing a forced unmount of a filesystem which has a filesystem below it, but in the normal case of unmounting a leaf filesystem I don't see where it would have multiple filesystems busy concurrently. I see vfs_stall() doing 1 lock per filesystem. Why does this report > say there are duplicates? > The warning is not that a single filesystem is being locked recursively by a single thread, but just that a single thread is holding locks on multiple filesystems. Philip