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
This commit is contained in:
Takanori Watanabe 2004-10-02 17:17:04 +00:00
parent 0618f3dcba
commit d354520ebc

View File

@ -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);