Date: Mon, 12 Apr 2021 23:19:05 +0200 From: Alexander Lochmann <alexander.lochmann@tu-dortmund.de> To: freebsd-fs@freebsd.org Subject: [struct buf] Unlocked access to b_vflags? Message-ID: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de>
next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Xz9eTg4I9kRVYnhegqAunRptWFws7ufoi Content-Type: multipart/mixed; boundary="OaWKHepOEHtS7AaXTO6zf8SCoFordbWxv"; protected-headers="v1" From: Alexander Lochmann <alexander.lochmann@tu-dortmund.de> To: freebsd-fs@freebsd.org Message-ID: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> Subject: [struct buf] Unlocked access to b_vflags? --OaWKHepOEHtS7AaXTO6zf8SCoFordbWxv Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi folks, I'm was digging through our data set when I encountered a strange situati= on: According to the code in trunc_dependencies() in sys/ufs/ffs/ffs_softdep.= c, the bo_lock should be held. At least that's how I read the code. However, we see several thousands of accesses to b_vflags without the=20 bo_lock held. At least the own b_lock is acquired. The access happens in line 7549: bp->b_vflags |=3D BV_SCANNED; [1] Can you please shed some light on this situation? Is the b_lock sufficeint, and somehow overrules the bo_lock? Am I missing something? FYI, some information about the greater context: I'm still trying to=20 understand FreeBSD's locking. This is needed to properly port our=20 approach. LockDoc, at the moment, seems to miss some cases on FreeBSD. Regards, Alex [1]=20 https://github.com/freebsd/freebsd-src/blob/main/sys/ufs/ffs/ffs_softdep.= c#L7549 --=20 Technische Universit=C3=A4t 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 --OaWKHepOEHtS7AaXTO6zf8SCoFordbWxv-- --Xz9eTg4I9kRVYnhegqAunRptWFws7ufoi Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEElhZsUHzVP0dbkjCRWT7tBbw+9v0FAmB0uUkFAwAAAAAACgkQWT7tBbw+9v3g Ng//d7n02bCqGpTXFLktsM2AWic4waI9AfGBcbZfxeNDMjVML/IMkLg7HDR7z5HE1QfXs2V2F12R yVypFjrtlFyKbilVhiBz8IJ88toonNPwzW121JpanJ2OVr+C4ZYz7y/3KiUMRnGsP0A6S+Ii1r4X 0/FR7N5bP2o3bII72LPnjnkNMwq7dm7pCOFFvO271m+/bbhyITGpC6UVdfpB3SvtBjMkV3wctcFE GAzVk+OwPWDMYtimSOe9tmcQsjFl/t3+WUIHNvg+yW2YcolDqmQ+beCjCB33IUCzmH4FLMycl3Pp oVCXrfRg2GRiUCBAUJy3X2yLc7izxPdURXGZR1zsZ4qaOnA6RqDnSFUURx29Fxp/8f6/xW+NhtQR AXY8gPixFHbAz/fzt5t/f+L1wmBixBrUEH77qpTUPusRy8ZpDNVWvkHtfx0nAcMV/iAaGjZhbVl4 Sst8IIiLUZYWPZu8dRk2sYrdPJPuzrqwsaHKab/V9M/pfVtXbNY0sdS7yyFg866di72qUjaGsVbd CWT/gkghF2nDqmz/6YaI9EpQcGL8qNYrSV66TRC3YqZ7JXTSAuzR0E1+AIUkM8IpQRbrnUhNRnEu O1SnrO2er65SiBo8DySV9lNObbm7Eg+tP068jc9ZF9nSBtB3D8rwWk0gdlUay4GbRUmxue9yqOh1 ajI= =YaYS -----END PGP SIGNATURE----- --Xz9eTg4I9kRVYnhegqAunRptWFws7ufoi--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?792c8a3d-8ea6-073f-3fda-b3eb793ef2b9>