From owner-freebsd-hackers Tue Mar 5 16:47:10 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from green.bikeshed.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6677837B400; Tue, 5 Mar 2002 16:47:05 -0800 (PST) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.6/8.11.6) with ESMTP id g260l4K29454; Tue, 5 Mar 2002 19:47:04 -0500 (EST) (envelope-from green@green.bikeshed.org) Message-Id: <200203060047.g260l4K29454@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Takanori Watanabe Cc: hackers@freebsd.org Subject: Re: unionfs and getcwd problem. In-Reply-To: Your message of "Mon, 25 Feb 2002 23:35:10 +0900." <200202251435.XAA91094@shidahara1.planet.sci.kobe-u.ac.jp> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Mar 2002 19:47:03 -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Takanori Watanabe wrote: > Hi, I had trouble with unionfs when it calles getcwd(3) when > I mount some directory on the directry in same file system,like > mount -t union /usr/home/foo/bar /usr/src/sys/ . > > I investigate the problem by inserting debug print in getcwd.c. > Then I found issuing __getcwd(2) in getcwd(3) failed, and > climb up filesystem tree as the next way. But it failed when > it reaches to mount point. It seems that st_dev and st_ino > member returns the same number as the underlying filesystem > so it failed to recognize mount point. So I tried the patch as > follows taken from nullfs. Are there any problem with this patch? It looks fine to me. I know you definitely need to provide this behavior when doing a "wrapper" filesystem to behave like the system's stat() :) > Takanori Watanabe > > Public Key > Key fingerprint = 2C 51 E2 78 2C E1 C5 2D 0F F1 20 A3 11 3A 62 2A > > > --- union_vnops.c~ Tue Oct 2 00:01:37 2001 > +++ union_vnops.c Mon Feb 25 22:44:51 2002 > @@ -957,6 +957,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); -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org <> bfeldman@tislabs.com \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message