Date: Tue, 05 Mar 2002 19:47:03 -0500 From: "Brian F. Feldman" <green@freebsd.org> To: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp> Cc: hackers@freebsd.org Subject: Re: unionfs and getcwd problem. Message-ID: <200203060047.g260l4K29454@green.bikeshed.org> In-Reply-To: Your message of "Mon, 25 Feb 2002 23:35:10 %2B0900." <200202251435.XAA91094@shidahara1.planet.sci.kobe-u.ac.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp> 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 > <a href="http://www.planet.sci.kobe-u.ac.jp/~takawata/key.html"> > Public Key</a> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203060047.g260l4K29454>