From owner-freebsd-current Sat Feb 27 13:10:36 1999 Delivered-To: freebsd-current@freebsd.org Received: from server.noc.demon.net (server.noc.demon.net [193.195.224.4]) by hub.freebsd.org (Postfix) with ESMTP id 7943F15138 for ; Sat, 27 Feb 1999 13:10:21 -0800 (PST) (envelope-from fanf@demon.net) Received: by server.noc.demon.net; id VAA24134; Sat, 27 Feb 1999 21:10:04 GMT Received: from fanf.noc.demon.net(195.11.55.83) by inside.noc.demon.net via smap (3.2) id xma024118; Sat, 27 Feb 99 21:10:00 GMT Received: from fanf by fanf.noc.demon.net with local (Exim 1.73 #2) id 10Gqzj-0004Fk-00; Sat, 27 Feb 1999 21:09:55 +0000 To: current@freebsd.org From: Tony Finch Cc: Tony Finch Subject: Re: mount -o union broken recently? In-Reply-To: References: Message-Id: Date: Sat, 27 Feb 1999 21:09:55 +0000 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Julian Elischer 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