mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-17 08:00:48 +01:00
Do a vnode_pager_uncache after the VOP_RENAME to lose the remaining
reference to the old vnode. Suggested by: Bruce Evans
This commit is contained in:
parent
2469b9a2ef
commit
519b3d1aa6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6785
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.16 1994/11/04 14:41:34 davidg Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.17 1995/02/13 13:45:04 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -938,7 +938,7 @@ unlink(p, uap, retval)
|
||||
if (vp->v_flag & VROOT)
|
||||
error = EBUSY;
|
||||
else
|
||||
(void)vnode_pager_uncache(vp);
|
||||
(void) vnode_pager_uncache(vp);
|
||||
}
|
||||
|
||||
if (!error) {
|
||||
@ -1854,6 +1854,8 @@ out:
|
||||
LEASE_CHECK(tvp, p, p->p_ucred, LEASE_WRITE);
|
||||
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)
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.16 1994/11/04 14:41:34 davidg Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.17 1995/02/13 13:45:04 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -938,7 +938,7 @@ unlink(p, uap, retval)
|
||||
if (vp->v_flag & VROOT)
|
||||
error = EBUSY;
|
||||
else
|
||||
(void)vnode_pager_uncache(vp);
|
||||
(void) vnode_pager_uncache(vp);
|
||||
}
|
||||
|
||||
if (!error) {
|
||||
@ -1854,6 +1854,8 @@ out:
|
||||
LEASE_CHECK(tvp, p, p->p_ucred, LEASE_WRITE);
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user