tmpfs_reclaim() has to make sure that the VFS cache has no more
locks held for the vnode. Else vclean() could panic because v_holdcnt
is non-zero.

I know that tmpfs is disabled by default, but it would be nice
to have this fix in the code base anyway.

Gerhard


Index: sys/tmpfs/tmpfs_vnops.c
===================================================================
RCS file: /cvs/src/sys/tmpfs/tmpfs_vnops.c,v
retrieving revision 1.42
diff -u -p -u -p -r1.42 tmpfs_vnops.c
--- sys/tmpfs/tmpfs_vnops.c     11 Jun 2020 09:18:43 -0000      1.42
+++ sys/tmpfs/tmpfs_vnops.c     13 Jul 2020 09:48:37 -0000
@@ -1080,6 +1080,8 @@ tmpfs_reclaim(void *v)
        racing = TMPFS_NODE_RECLAIMING(node);
        rw_exit_write(&node->tn_nlock);
 
+       cache_purge(vp);
+
        /*
         * If inode is not referenced, i.e. no links, then destroy it.
         * Note: if racing - inode is about to get a new vnode, leave it.

Reply via email to