From owner-freebsd-hackers Mon Feb 25 6:36:10 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from shidahara1.planet.sci.kobe-u.ac.jp (shidahara1.planet.sci.kobe-u.ac.jp [133.30.68.253]) by hub.freebsd.org (Postfix) with ESMTP id DBBDD37B402 for ; Mon, 25 Feb 2002 06:36:02 -0800 (PST) Received: from shidahara1.planet.sci.kobe-u.ac.jp (localhost [127.0.0.1]) by shidahara1.planet.sci.kobe-u.ac.jp (8.9.3/8.9.3) with ESMTP id XAA91094 for ; Mon, 25 Feb 2002 23:35:10 +0900 (JST) (envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp) Message-Id: <200202251435.XAA91094@shidahara1.planet.sci.kobe-u.ac.jp> To: hackers@freebsd.org Subject: unionfs and getcwd problem. Date: Mon, 25 Feb 2002 23:35:10 +0900 From: Takanori Watanabe 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 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? 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); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message