Fixed vnode corruption by undefined case in union_lookup(). When

uerror == 0 && lerror == EACCES, lowervp == NULLVP and union_allocvp
doesn't find existing union node and new union node is created.

Sicne it is dificult to cover all the case, union_lookup always
returns when union_lookup1() returns EACCES.

Submitted by:	Naofumi Honda <honda@Kururu.math.sci.hokudai.ac.jp>
Obtained from:	NetBSD/pc98
This commit is contained in:
KATO Takenori 1997-08-12 07:18:59 +00:00
parent 685cca7da6
commit f8fc96b551
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28101
2 changed files with 14 additions and 6 deletions

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
* $Id: union_vnops.c,v 1.33 1997/05/03 01:55:19 kato Exp $
* $Id: union_vnops.c,v 1.34 1997/05/07 14:37:32 kato Exp $
*/
#include <sys/param.h>
@ -286,7 +286,9 @@ union_lookup(ap)
/*if (uppervp == upperdvp)
dun->un_flags |= UN_KLOCK;*/
if (cnp->cn_consume != 0) {
if (cnp->cn_consume != 0 || uerror == EACCES) {
if (uerror == EACCES)
uppervp = NULLVP;
*ap->a_vpp = uppervp;
if (!lockparent)
cnp->cn_flags &= ~LOCKPARENT;
@ -343,7 +345,9 @@ union_lookup(ap)
if (lowervp != lowerdvp)
VOP_UNLOCK(lowerdvp, 0, p);
if (cnp->cn_consume != 0) {
if (cnp->cn_consume != 0 || lerror == EACCES) {
if (lerror == EACCES)
lowervp = NULLVP;
if (uppervp != NULLVP) {
if (uppervp == upperdvp)
vrele(uppervp);

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
* $Id: union_vnops.c,v 1.33 1997/05/03 01:55:19 kato Exp $
* $Id: union_vnops.c,v 1.34 1997/05/07 14:37:32 kato Exp $
*/
#include <sys/param.h>
@ -286,7 +286,9 @@ union_lookup(ap)
/*if (uppervp == upperdvp)
dun->un_flags |= UN_KLOCK;*/
if (cnp->cn_consume != 0) {
if (cnp->cn_consume != 0 || uerror == EACCES) {
if (uerror == EACCES)
uppervp = NULLVP;
*ap->a_vpp = uppervp;
if (!lockparent)
cnp->cn_flags &= ~LOCKPARENT;
@ -343,7 +345,9 @@ union_lookup(ap)
if (lowervp != lowerdvp)
VOP_UNLOCK(lowerdvp, 0, p);
if (cnp->cn_consume != 0) {
if (cnp->cn_consume != 0 || lerror == EACCES) {
if (lerror == EACCES)
lowervp = NULLVP;
if (uppervp != NULLVP) {
if (uppervp == upperdvp)
vrele(uppervp);