From a8c800a898b49a5beeb7ded030d538a1323da6e0 Mon Sep 17 00:00:00 2001 From: dillon Date: Tue, 28 Sep 1999 05:48:39 +0000 Subject: 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. --- sys/fs/unionfs/union_subr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/fs/unionfs/union_subr.c') diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index c03153c..7c3dbb9 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -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; } -- cgit v1.1