Re: Various unprotected accesses to buf and vnode

From: Alexander Lochmann <>
Date: Thu, 2 Sep 2021 09:34:39 +0200
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
> Please remind me what attributions to use for 'Reported by:' tagline.
Last time it was '[...] issue was reported by	Alexander Lochmann
<>, who found the problem by performing
lock analysis using LockDoc, see'
>>> 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
Received on Thu Sep 02 2021 - 07:34:39 UTC

Original text of this message