diff options
author | kato <kato@FreeBSD.org> | 1997-05-02 03:21:54 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1997-05-02 03:21:54 +0000 |
commit | 7268d74c7c333f23a58714dcd9c813d273c24745 (patch) | |
tree | d8d213c5170f67a884d480fd69a1d57bf6704d0b /sys/miscfs | |
parent | edf3f0421201331e0bf4af4027653f42aaa59acd (diff) | |
download | FreeBSD-src-7268d74c7c333f23a58714dcd9c813d273c24745.zip FreeBSD-src-7268d74c7c333f23a58714dcd9c813d273c24745.tar.gz |
Access correct union mount point in union_access. Old vnode is saved
in savedvp variable and it is used for the argument of
MOUNTTOUNIONMOUNT(). I didn't realize ap->a_vp is modified before
MOUNTTOUNIONMOUNT(), so the change by revision 1.22 is incorrect.
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/union/union_vnops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c index 00e48622..a8b51e4 100644 --- a/sys/miscfs/union/union_vnops.c +++ b/sys/miscfs/union/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95 - * $Id: union_vnops.c,v 1.30 1997/04/27 10:49:37 kato Exp $ + * $Id: union_vnops.c,v 1.31 1997/04/29 02:06:07 kato Exp $ */ #include <sys/param.h> @@ -644,6 +644,7 @@ union_access(ap) struct proc *p = ap->a_p; int error = EACCES; struct vnode *vp; + struct vnode *savedvp; if ((vp = un->un_uppervp) != NULLVP) { FIXUP(un, p); @@ -653,10 +654,11 @@ union_access(ap) if ((vp = un->un_lowervp) != NULLVP) { vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); + savedvp = ap->a_vp; ap->a_vp = vp; error = VCALL(vp, VOFFSET(vop_access), ap); if (error == 0) { - struct union_mount *um = MOUNTTOUNIONMOUNT(ap->a_vp->v_mount); + struct union_mount *um = MOUNTTOUNIONMOUNT(savedvp->v_mount); if (um->um_op == UNMNT_BELOW) { ap->a_cred = um->um_cred; |