CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]  2026/11/08 09:35:01

Modified files:
        sys/isofs/cd9660: cd9660_vfsops.c 
        sys/isofs/udf  : udf_vfsops.c 
        sys/kern       : vfs_default.c vfs_subr.c 
        sys/nfs        : nfs_subs.c 
        sys/sys        : vnode.h 
        sys/tmpfs      : tmpfs_subr.c 
        sys/ufs/ext2fs : ext2fs_subr.c 
        sys/ufs/ffs    : ffs_subr.c 
        sys/ufs/mfs    : mfs_vfsops.c 

Log message:
sys/vfs: stop checkalias replacing vnodes

checkalias() mixed two contracts: it linked a special vnode into the
alias list, but in the VT_NON block device case it returned an existing
alias and forced the caller to discard the vnode it had just
constructed. That is not a valid generic contract once filesystem
private lookup caches can already name the provisional vnode; the node
to vnode relation changes under concurrent lookup, and callers have to
move v_data and vgone() a vnode which is no longer private.

Make checkalias() only register the supplied vnode in speclisth and mark
alias peers with VALIASED. The function no longer returns a replacement
vnode, and callers keep their filesystem vnode identity stable.

Keep the historical bdevvp() reuse case local to getdevvp(): look up an
active VT_NON block device vnode before allocating a new vnode, and
return it directly when present. This preserves device vnode sharing
without making checkalias() consume caller owned vnodes.

OK: beck@, deraadt@

Reply via email to