Skip to content

Commit 550dede

Browse files
traszmarkjdb
authored andcommitted
Fix "vrefact: wrong use count 0" with DRM
Bump the vnode use count, not its hold count. This fixes a panic triggered by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be what glxinfo(1) from Ubuntu Jammy is doing. PR: kern/274538 Reviewed By: kib (earlier version), olce Differential Revision: https://reviews.freebsd.org/D47391 (cherry picked from commit fc595a6)
1 parent e2d4c5d commit 550dede

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sys/compat/linuxkpi/common/src/linux_compat.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td,
948948
}
949949

950950
/* hold on to the vnode - used for fstat() */
951-
vhold(filp->f_vnode);
951+
vref(filp->f_vnode);
952952

953953
/* release the file from devfs */
954954
finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops);
@@ -1680,7 +1680,7 @@ linux_file_close(struct file *file, struct thread *td)
16801680
error = -OPW(file, td, release(filp->f_vnode, filp));
16811681
funsetown(&filp->f_sigio);
16821682
if (filp->f_vnode != NULL)
1683-
vdrop(filp->f_vnode);
1683+
vrele(filp->f_vnode);
16841684
linux_drop_fop(ldev);
16851685
ldev = filp->f_cdev;
16861686
if (ldev != NULL)

0 commit comments

Comments
 (0)