RFC: LockDoc - Detecting Locking Bugs in the FreeBSD Kernel
Konstantin Belousov
kostikbel at gmail.com
Tue May 28 12:11:53 UTC 2019
On Tue, May 28, 2019 at 01:36:37PM +0200, Alexander Lochmann wrote:
> Thanks for your fast feedback!
>
> On 28.05.19 12:55, Konstantin Belousov wrote:
> >>
> >> It might be possible that LockDoc considers a certain access as a bug
> >> due to an incomplete blacklist of init and destroy functions.
> >> Hence, we appreciate any feedback refining our blacklist.
> > It is worse. I did quick look, and all the issues among 5 I looked at
> > where reported because the tool does not understand the vnode visibility.
> > It is safe to access a vnode without holding any locks as far as the vnode
> > cannot be found by other threads.
> At which data type have you looked at? vnode?
> Can you please tell us which functions should be blacklisted?
No, I cannot, this was the sole point of my response.
> We have an idea in mind to overcome that issue. For now, we have to rely
> on the function blacklist.
> >
> > For instance, while mount (VFS_MOUNT) initializes the filesystem, VFS
> > ensures that no thread could ever reach into it, e.g. by lookups. One
> > way of ensuring it is by locking the covered vnode. So a report that
> > devfs mount operates on some not-enough-locked vnode is false positive.
> >
> Can you please tell us to which report you are referring to?
> > Same for the freshly created vnode on the mounted filesystem, while the
> > vnode not inserted into vfs hash or mount point vnode' list. In fact,
> > we typically lock the new vnode exclusively right before adding to
> > hash and calling insmntque(), exactly to prevent other threads to operate
> > on partially initialized vnode.
> Dito.
>
> - Alex
>
> >
> > There could be valid reports, but digging in the present amount of reports
> > with false positive is mostly equivalent to reviewing all mount/unmount
> > and vnode creation/reclamation paths. It is too much to spend time usefully,
> > IMO.
> >
>
> --
> Technische Universität Dortmund
> Alexander Lochmann PGP key: 0xBC3EF6FD
> Otto-Hahn-Str. 16 phone: +49.231.7556141
> D-44227 Dortmund fax: +49.231.7556116
> http://ess.cs.tu-dortmund.de/Staff/al
>
More information about the freebsd-fs
mailing list