Date: 06 Mar 2002 14:50:43 +0300 From: "Vladimir B. " Grebenschikov <vova@express.ru> To: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp> Cc: hackers@freebsd.org Subject: Re: unionfs and getcwd problem. Message-ID: <1015415443.3157.2.camel@vbook.express.ru> In-Reply-To: <200202251435.XAA91094@shidahara1.planet.sci.kobe-u.ac.jp> References: <200202251435.XAA91094@shidahara1.planet.sci.kobe-u.ac.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2002-02-25 at 17:35, 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? patch below will turn on caching on unionfs, and solve getcwd problem, patch against -CURRENT --- /usr/src/sys/fs/unionfs/union_vnops.c Sat Feb 23 13:54:45 2002 +++ union_vnops.c Wed Mar 6 14:44:59 2002 @@ -561,6 +561,9 @@ */ out: + if ((error == 0 || error == ENOENT) && saveflags & MAKEENTRY && cnp->cn_nameiop != CREATE) { + cache_enter(dvp, *ap->a_vpp, cnp); + } if (upperdvp) { if (upperdvp == uppervp || upperdvp == *ap->a_vpp) vrele(upperdvp); @@ -1931,7 +1934,8 @@ { &vop_lease_desc, (vop_t *) union_lease }, { &vop_link_desc, (vop_t *) union_link }, { &vop_lock_desc, (vop_t *) union_lock }, - { &vop_lookup_desc, (vop_t *) union_lookup }, + { &vop_cachedlookup_desc, (vop_t *) union_lookup }, + { &vop_lookup_desc, (vop_t *) vfs_cache_lookup }, { &vop_mkdir_desc, (vop_t *) union_mkdir }, { &vop_mknod_desc, (vop_t *) union_mknod }, { &vop_open_desc, (vop_t *) union_open > Takanori Watanabe -- TSB "Russian Express", Moscow Vladimir B. Grebenschikov, vova@express.ru 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?1015415443.3157.2.camel>