Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Feb 2002 23:35:10 +0900
From:      Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
To:        hackers@freebsd.org
Subject:   unionfs and getcwd problem.
Message-ID:  <200202251435.XAA91094@shidahara1.planet.sci.kobe-u.ac.jp>

next in thread | raw e-mail | index | archive | help
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
<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);



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?200202251435.XAA91094>