From owner-freebsd-stable@FreeBSD.ORG Tue Jun 8 09:03:21 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5AF3D16A4CE for ; Tue, 8 Jun 2004 09:03:21 +0000 (GMT) Received: from dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NOSPAM.dyndns.dk (80-219-172-121.dclient.hispeed.ch [80.219.172.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DBB143D39 for ; Tue, 8 Jun 2004 09:03:20 +0000 (GMT) (envelope-from bounce@NOSPAM.dyndns.dk) Received: from Mail.NOSPAM.DynDNS.dK (ipv6.NOSPAM.dyndns.dk [2002:50db:ac79:0:250:daff:fe5a:2107]) (8.11.6/8.11.6-SPAMMERS-DeLiGHt) with ESMTP id i5893B601552 verified NO) for ; Tue, 8 Jun 2004 11:03:17 +0200 (CEST) (envelope-from bounce@NOSPAM.dyndns.dk) Received: (from beer@localhost) by Mail.NOSPAM.DynDNS.dK (8.11.6/FNORD) id i5893AO01551; Tue, 8 Jun 2004 11:03:11 +0200 (CEST) (envelope-from bounce@NOSPAM.dyndns.dk) Date: Tue, 8 Jun 2004 11:03:11 +0200 (CEST) Message-Id: <200406080903.i5893AO01551@Mail.NOSPAM.DynDNS.dK> X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: beer set sender to bounce@NOSPAM.dyndns.dk using -f X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed from queue /tmp X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed by beer with -C /etc/mail/sendmail.cf-LOCAL From: Barry Bouwsma To: Stability of FreeBSD Subject: patch for unionfs mounts X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2004 09:03:21 -0000 [drop the above ipv6-only address that only sometimes works from the recipients and I'll catch up later from the archives, thanks] Salutations, comrades. I've got a bunch of patches that I apply to my 4.x source before building world, some of which seem to be worthy of merging into the official RELENG_4 branch. I'm wondering if someone would be interested in this: I've applied this particular patch for an eternity without quite remembering why. After failing to apply it, it's clear, and rather worthy of inclusion. This is a unionfs patch, that I pulled from either the PR database or from the mailing lists several years ago. Without this patch, a getcwd() call (from csh, and others, but apparently not bash) returns the upper unionfs-mounted layer. This breaks things like `make world' and its ilk when one mounts, say, /usr/source-hacks atop /usr/src (perhaps additional intermediate directories, like /usr/local/source-hacks, are necessary to demonstrate the problem). In other words, when one is in /usr/src (or /usr/local/source-hacks) and asks for getcwd(), several shells return /usr/local/source-hacks instead of /usr/src, without this patch, which as noted breaks buildworlds. (Or perhaps in subdirectories -- I don't recall) After applying this patch, a getcwd() call returns /usr/src, no matter what shell, which allows buildworlds to complete. I've had this patch for years, and never had any problems with it. I've only had problems without including it. The trivial one-liner patch is as follows: --- union_vnops.c-ORIG Tue Jan 13 22:20:02 2004 +++ union_vnops.c Tue May 11 14:49:02 2004 @@ -963,6 +963,8 @@ union_newsize(ap->a_vp, VNOVAL, vap->va_size); } + ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0]; + if ((vap != ap->a_vap) && (vap->va_type == VDIR)) ap->a_vap->va_nlink += vap->va_nlink; return (0); As noted, without this, builds fail with a union-mounted directory of hacks atop the pristine virginal /usr/src. With this patch, no ill effects have been noted. Sorry if this is in a PR that hasn't yet been addressed (I was too lazy to grep all the PRs or the entire mailing list archives). And sorry if this should be another PR (I'm offline and can't access the official submit site when I have time to spare). If others use this, with or without problems, that would be good to know too. thanks barry bouwsma