From d354520ebc31948c1edfd55e0502c18ec8a986d3 Mon Sep 17 00:00:00 2001 From: Takanori Watanabe Date: Sat, 2 Oct 2004 17:17:04 +0000 Subject: [PATCH] Fix a problem when you try to mount a directory on another directory belongs to the same filesystem. In this problem, getcwd(3) will fail. I found the problem two years ago and I have forgotten to merge. http://docs.FreeBSD.org/cgi/mid.cgi?200202251435.XAA91094 --- sys/fs/unionfs/union_vnops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index c8240e9973a..89673dff2cb 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -972,6 +972,8 @@ union_getattr(ap) 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);