Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Feb 1999 21:09:55 +0000
From:      Tony Finch <dot@dotat.at>
To:        current@freebsd.org
Cc:        Tony Finch <dot@dotat.at>
Subject:   Re: mount -o union broken recently?
Message-ID:  <E10Gqzj-0004Fk-00@fanf.noc.demon.net>
In-Reply-To: <Pine.BSF.3.95.990226231312.12872H-100000@current1.whistle.com>
References:  <XFMail.990226222547.jdp@polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer <julian@whistle.com> wrote:
>On Fri, 26 Feb 1999, John Polstra wrote:
>> Julian Elischer wrote:
>> > you want to commit?
>> > 
>> > (after you sir...)
>> 
>> No, really, after you ... :-)
>
>Done
>in 3.1 and 4

I just remembered that MNT_UNION occurs in another file which on
investigation turned out to be amongst the unionfs code that was
moved. It should be removed so that the code isn't run twice when
unionfs is enabled. Sorry for missing it the first time round! I also
tidied up the vfs_syscalls patch a bit.

Tony.
-- 
f.a.n.finch  dot@dotat.at  fanf@demon.net


--- miscfs/union/union_subr.c.3.1	Sat Feb 27 20:44:14 1999
+++ miscfs/union/union_subr.c	Sat Feb 27 20:47:28 1999
@@ -1183,15 +1183,6 @@
 			return -1;	/* goto unionread */
 		}
 	}
-	if (((*vp)->v_flag & VROOT) && ((*vp)->v_mount->mnt_flag & MNT_UNION)) {
-		struct vnode *tvp = *vp;
-		*vp = (*vp)->v_mount->mnt_vnodecovered;
-		VREF(*vp);
-		fp->f_data = (caddr_t) *vp;
-		fp->f_offset = 0;
-		vrele(tvp);
-		return -1;	/* goto unionread */
-	}
 	return error;
 }
 
--- kern/vfs_syscalls.c.3.2	Sat Feb 27 20:55:32 1999
+++ kern/vfs_syscalls.c	Sat Feb 27 21:00:26 1999
@@ -2756,23 +2756,24 @@
 	VOP_UNLOCK(vp, 0, p);
 	if (error)
 		return (error);
-	if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
-		error = union_dircheckp(p, &vp, fp);
-		if (error == -1)
+	if (SCARG(uap, count) == auio.uio_resid) {
+		if (union_dircheckp) {
+			error = union_dircheckp(p, &vp, fp);
+			if (error == -1)
+				goto unionread;
+			if (error)
+				return (error);
+		}
+		if ((vp->v_flag & VROOT) &&
+		    (vp->v_mount->mnt_flag & MNT_UNION)) {
+			struct vnode *tvp = vp;
+			vp = vp->v_mount->mnt_vnodecovered;
+			VREF(vp);
+			fp->f_data = (caddr_t) vp;
+			fp->f_offset = 0;
+			vrele(tvp);
 			goto unionread;
-		if (error)
-			return (error);
-	}
-	if ((SCARG(uap, count) == auio.uio_resid) &&
-	    (vp->v_flag & VROOT) &&
-	    (vp->v_mount->mnt_flag & MNT_UNION)) {
-		struct vnode *tvp = vp;
-		vp = vp->v_mount->mnt_vnodecovered;
-		VREF(vp);
-		fp->f_data = (caddr_t) vp;
-		fp->f_offset = 0;
-		vrele(tvp);
-		goto unionread;
+		}
 	}
 	error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
 	    sizeof(long));
@@ -2833,23 +2834,24 @@
 	VOP_UNLOCK(vp, 0, p);
 	if (error)
 		return (error);
-	if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
-		error = union_dircheckp(p, &vp, fp);
-		if (error == -1)
+	if (SCARG(uap, count) == auio.uio_resid) {
+		if (union_dircheckp) {
+			error = union_dircheckp(p, &vp, fp);
+			if (error == -1)
+				goto unionread;
+			if (error)
+				return (error);
+		}
+		if ((vp->v_flag & VROOT) &&
+		    (vp->v_mount->mnt_flag & MNT_UNION)) {
+			struct vnode *tvp = vp;
+			vp = vp->v_mount->mnt_vnodecovered;
+			VREF(vp);
+			fp->f_data = (caddr_t) vp;
+			fp->f_offset = 0;
+			vrele(tvp);
 			goto unionread;
-		if (error)
-			return (error);
-	}
-	if ((SCARG(uap, count) == auio.uio_resid) &&
-	    (vp->v_flag & VROOT) &&
-	    (vp->v_mount->mnt_flag & MNT_UNION)) {
-		struct vnode *tvp = vp;
-		vp = vp->v_mount->mnt_vnodecovered;
-		VREF(vp);
-		fp->f_data = (caddr_t) vp;
-		fp->f_offset = 0;
-		vrele(tvp);
-		goto unionread;
+		}
 	}
 	if (SCARG(uap, basep) != NULL) {
 		error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E10Gqzj-0004Fk-00>