Make sure file after VOP_OPEN is VMIO'd when transfering control from
a lower layer to an upper layer. I'm not sure how necessary this is for reading. Fix bug in union_lookup() (note: there are probably still several bugs in union_lookup()). This one set lerror as a side effect without setting lowervp, causing copyup code further on down to crash on a null lowervp pointer. Changed the side effect to use a temporary variable instead.
This commit is contained in:
parent
8bd2d9a0e6
commit
e3a285c715
@ -807,8 +807,10 @@ union_copyup(un, docopy, cred, p)
|
||||
(void) VOP_CLOSE(lvp, FREAD, cred, p);
|
||||
(void) VOP_OPEN(uvp, FREAD, cred, p);
|
||||
}
|
||||
if (vn_canvmio(uvp) == TRUE)
|
||||
error = vfs_object_create(uvp, p, cred);
|
||||
if (un->un_openl) {
|
||||
if (vn_canvmio(uvp) == TRUE)
|
||||
error = vfs_object_create(uvp, p, cred);
|
||||
}
|
||||
un->un_openl = 0;
|
||||
}
|
||||
|
||||
|
@ -404,9 +404,11 @@ union_lookup(ap)
|
||||
if (cnp->cn_flags & ISWHITEOUT) {
|
||||
iswhiteout = 1;
|
||||
} else if (lowerdvp != NULLVP) {
|
||||
lerror = VOP_GETATTR(upperdvp, &va,
|
||||
int terror;
|
||||
|
||||
terror = VOP_GETATTR(upperdvp, &va,
|
||||
cnp->cn_cred, cnp->cn_proc);
|
||||
if (lerror == 0 && (va.va_flags & OPAQUE))
|
||||
if (terror == 0 && (va.va_flags & OPAQUE))
|
||||
iswhiteout = 1;
|
||||
}
|
||||
}
|
||||
|
@ -807,8 +807,10 @@ union_copyup(un, docopy, cred, p)
|
||||
(void) VOP_CLOSE(lvp, FREAD, cred, p);
|
||||
(void) VOP_OPEN(uvp, FREAD, cred, p);
|
||||
}
|
||||
if (vn_canvmio(uvp) == TRUE)
|
||||
error = vfs_object_create(uvp, p, cred);
|
||||
if (un->un_openl) {
|
||||
if (vn_canvmio(uvp) == TRUE)
|
||||
error = vfs_object_create(uvp, p, cred);
|
||||
}
|
||||
un->un_openl = 0;
|
||||
}
|
||||
|
||||
|
@ -404,9 +404,11 @@ union_lookup(ap)
|
||||
if (cnp->cn_flags & ISWHITEOUT) {
|
||||
iswhiteout = 1;
|
||||
} else if (lowerdvp != NULLVP) {
|
||||
lerror = VOP_GETATTR(upperdvp, &va,
|
||||
int terror;
|
||||
|
||||
terror = VOP_GETATTR(upperdvp, &va,
|
||||
cnp->cn_cred, cnp->cn_proc);
|
||||
if (lerror == 0 && (va.va_flags & OPAQUE))
|
||||
if (terror == 0 && (va.va_flags & OPAQUE))
|
||||
iswhiteout = 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user