Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Sep 2021 09:34:39 +0200
From:      Alexander Lochmann <alexander.lochmann@tu-dortmund.de>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-fs <freebsd-fs@freebsd.org>, Horst Schirmeier <horst@schirmeier.de>
Subject:   Re: Various unprotected accesses to buf and vnode
Message-ID:  <6640b87e-cc47-589b-40a6-7f181d3f077f@tu-dortmund.de>
In-Reply-To: <YTBQFdIP/sh1trB7@kib.kiev.ua>
References:  <55f3661e-2173-793e-4834-bbcd79d3d99e@tu-dortmund.de> <YSkxgXyXZfNvrXA/@kib.kiev.ua> <380bdcc8-bede-2a64-8e5e-031552231d82@tu-dortmund.de> <YSqhe3WI8dVvUq7g@kib.kiev.ua> <46649402-d28a-6f81-f0a8-39180b681f4c@tu-dortmund.de> <YSq42Cb48SMv%2BsIO@kib.kiev.ua> <e50f4583-5150-a162-e188-7207e5e7eb61@tu-dortmund.de> <YS5AWi7k2ie2MB4u@kib.kiev.ua> <c4f7e26f-aa5a-aacb-51f7-5edbe5ebad47@tu-dortmund.de> <YTBQFdIP/sh1trB7@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help


On 02.09.21 06:16, Konstantin Belousov wrote:
> Ah, it is bp->b_blkno access after the b*write() functions were called
> to write out and release the buffer, right.  I put the patch to fix this
> into https://reviews.freebsd.org/D31780
> 
> Please remind me what attributions to use for 'Reported by:' tagline.
Last time it was '[...] issue was reported by	Alexander Lochmann
<alexander.lochmann@tu-dortmund.de>, who found the problem by performing
lock analysis using LockDoc, see https://doi.org/10.1145/3302424.3303948.'
> 
>>> Read e.g. sys/ufs/ufs/inode.h gerald comment above struct inode definition.
>>> It provides more detailed exposure.
>> Aaah. Thx. This is about the struct inode. So I assume it also applies
>> for a vnode belonging to an inode. Am I right?> Vnode lock is a lock
>> obtained with vn_lock().  It is up to filesystem
> When needed, yes, it is a reasonable locking strategy.  But I am not
> sure that we actually use for any of the struct vnode fields proper,
> Something closer to it is for v_writecount, but formally it is under the
> vnode interlock.  Although I do not think we ever modify it without holding
> vnode lock, in some mode.
Can this locking strategy be applied to a vnode for any other 
filesystem, ntfs for example?
If so: Shouldn't it be written down in vnode.h?

-- 
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6640b87e-cc47-589b-40a6-7f181d3f077f>