From owner-freebsd-fs@freebsd.org Tue May 28 12:11:53 2019 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08E5F15C059E for ; Tue, 28 May 2019 12:11:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 408F676A35 for ; Tue, 28 May 2019 12:11:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x4SCBgas075536 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 28 May 2019 15:11:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4SCBgas075536 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4SCBgVi075535; Tue, 28 May 2019 15:11:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 28 May 2019 15:11:42 +0300 From: Konstantin Belousov To: Alexander Lochmann Cc: freebsd-fs@freebsd.org, Horst Schirmeier Subject: Re: RFC: LockDoc - Detecting Locking Bugs in the FreeBSD Kernel Message-ID: <20190528121142.GI2748@kib.kiev.ua> References: <67482bf7-be1a-8f8d-ca80-2087bfc8cf99@tu-dortmund.de> <20190528105529.GH2748@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 12:11:53 -0000 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 >