Module Name: src
Committed By: martin
Date: Tue Nov 6 14:47:38 UTC 2018
Modified Files:
src/sys/fs/puffs [netbsd-8]: puffs_vnops.c
Log Message:
Pull up following revision(s) (requested by manu in ticket #1082):
sys/fs/puffs/puffs_vnops.c: revision 1.213
Fix use after RECLAIM in PUFFS filesystems
>From hannken@
When puffs_cookie2vnode() misses an entry and vrele() it operations
puffs_vnop_reclaim() and puffs_vnop_fsync() get called with a VNON
vnode.
Do not notify the server in this case as the cookie is stale.
To generate a diff of this commit:
cvs rdiff -u -r1.211 -r1.211.2.1 src/sys/fs/puffs/puffs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.211 src/sys/fs/puffs/puffs_vnops.c:1.211.2.1
--- src/sys/fs/puffs/puffs_vnops.c:1.211 Fri May 26 14:21:01 2017
+++ src/sys/fs/puffs/puffs_vnops.c Tue Nov 6 14:47:38 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_vnops.c,v 1.211 2017/05/26 14:21:01 riastradh Exp $ */
+/* $NetBSD: puffs_vnops.c,v 1.211.2.1 2018/11/06 14:47:38 martin Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.211 2017/05/26 14:21:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.211.2.1 2018/11/06 14:47:38 martin Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -1467,6 +1467,10 @@ puffs_vnop_reclaim(void *v)
notifyserver = false;
}
+ /* See the comment on top of puffs_vnop_inactive(). */
+ if (vp->v_type == VNON)
+ notifyserver = false;
+
/*
* purge info from kernel before issueing FAF, since we
* don't really know when we'll get around to it after
@@ -1720,6 +1724,11 @@ puffs_vnop_fsync(void *v)
pn = VPTOPP(vp);
KASSERT(pn != NULL);
pmp = MPTOPUFFSMP(vp->v_mount);
+
+ /* See the comment on top of puffs_vnop_inactive(). */
+ if (vp->v_type == VNON)
+ return 0;
+
if (ap->a_flags & FSYNC_WAIT) {
mutex_enter(&pn->pn_sizemtx);
} else {