summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-03-19 11:16:58 +0000
committerdg <dg@FreeBSD.org>1995-03-19 11:16:58 +0000
commita62ef20881c9a8d16a33aa99ae87dcfb0f091775 (patch)
treea1c628962d533fbde7688411e97f4c1cd4d7ecc6
parent1c5e8a2ae0deaa059eb02e20d29849d00b33194c (diff)
downloadFreeBSD-src-a62ef20881c9a8d16a33aa99ae87dcfb0f091775.zip
FreeBSD-src-a62ef20881c9a8d16a33aa99ae87dcfb0f091775.tar.gz
Moved call to vnode_pager_uncache in rename() to before the VOP_RENAME.
It was previously after the VOP_RENAME and the reference and lock on the vnode had already been lost, allowing interesting internel inconsistencies. This is one of the two reasons why freefall was crashing every hour or two (the other being nullfs bugs). Don't call vnode_pager_uncache in revoke(). revoke() is only allowed on VCHR and VBLK vnodes.
-rw-r--r--sys/kern/vfs_extattr.c10
-rw-r--r--sys/kern/vfs_syscalls.c10
2 files changed, 8 insertions, 12 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 0596362..60aef32 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.18 1995/02/28 02:52:48 davidg Exp $
+ * $Id: vfs_syscalls.c,v 1.19 1995/03/16 18:12:50 bde Exp $
*/
#include <sys/param.h>
@@ -1850,12 +1850,12 @@ out:
LEASE_CHECK(tdvp, p, p->p_ucred, LEASE_WRITE);
if (fromnd.ni_dvp != tdvp)
LEASE_CHECK(fromnd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
- if (tvp)
+ if (tvp) {
LEASE_CHECK(tvp, p, p->p_ucred, LEASE_WRITE);
+ (void) vnode_pager_uncache(tvp);
+ }
error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd,
tond.ni_dvp, tond.ni_vp, &tond.ni_cnd);
- if (tvp && !error)
- (void) vnode_pager_uncache(tvp);
} else {
VOP_ABORTOP(tond.ni_dvp, &tond.ni_cnd);
if (tdvp == tvp)
@@ -2222,8 +2222,6 @@ revoke(p, uap, retval)
if (p->p_ucred->cr_uid != vattr.va_uid &&
(error = suser(p->p_ucred, &p->p_acflag)))
goto out;
- if( vp->v_vmdata)
- vnode_pager_uncache( vp);
if (vp->v_usecount > 1 || (vp->v_flag & VALIASED))
vgoneall(vp);
out:
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 0596362..60aef32 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.18 1995/02/28 02:52:48 davidg Exp $
+ * $Id: vfs_syscalls.c,v 1.19 1995/03/16 18:12:50 bde Exp $
*/
#include <sys/param.h>
@@ -1850,12 +1850,12 @@ out:
LEASE_CHECK(tdvp, p, p->p_ucred, LEASE_WRITE);
if (fromnd.ni_dvp != tdvp)
LEASE_CHECK(fromnd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
- if (tvp)
+ if (tvp) {
LEASE_CHECK(tvp, p, p->p_ucred, LEASE_WRITE);
+ (void) vnode_pager_uncache(tvp);
+ }
error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd,
tond.ni_dvp, tond.ni_vp, &tond.ni_cnd);
- if (tvp && !error)
- (void) vnode_pager_uncache(tvp);
} else {
VOP_ABORTOP(tond.ni_dvp, &tond.ni_cnd);
if (tdvp == tvp)
@@ -2222,8 +2222,6 @@ revoke(p, uap, retval)
if (p->p_ucred->cr_uid != vattr.va_uid &&
(error = suser(p->p_ucred, &p->p_acflag)))
goto out;
- if( vp->v_vmdata)
- vnode_pager_uncache( vp);
if (vp->v_usecount > 1 || (vp->v_flag & VALIASED))
vgoneall(vp);
out:
OpenPOWER on IntegriCloud