Date: Sun, 10 Mar 2002 22:47:13 +0100 (CET) From: BOUWSMA Beery <freebsd-user@dcf77-zeit.netscum.dyndns.dk> To: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp> Cc: "Vladimir B. " Grebenschikov <vova@express.ru>, hackers@freebsd.org Subject: Re: unionfs and getcwd problem. Message-ID: <200203102147.g2ALlDw00249@beerswilling.netscum.dyndns.dk> References: <200202251435.XAA91094@shidahara1.planet.sci.kobe-u.ac.jp> <1015415443.3157.2.camel@vbook.express.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
[replies sent directly to me may timeout and bounce, since I'm not
online as often as I should be, but I'll check the list archives]
Moin, moin!
%s wrote on %.3s, %lld Sep 1993
> 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/ .
[...]
> > so it failed to recognize mount point. So I tried the patch as
> > follows taken from nullfs. Are there any problem with this patch?
Thanks! I'm pleased to report that I applied your patch to my
-stable source, and now I'm able to `make buildworld' with my
rw unionfs mount of my local hacks, atop a ro nullfs mount with
unaltered source, which I'm doing right now.
The only obvious `problem' is when a non-r00t user attempts to
access the union-mounted fs when the shadow directories have not
yet been created, and `permission denied' is returned for all
directories that exist below, but not in the unionfs fs. E.g.:
| bash-2.05a$ ls -l /usr/src/sys/boot/
| ls: alpha: Permission denied
| ls: arc: Permission denied
| ls: forth: Permission denied
| ls: pc98: Permission denied
| total 20
| -rw-r--r-- 1 root wheel 516 Nov 15 1999 Makefile
| -rw-r--r-- 1 root wheel 11542 Jul 7 2000 README
| drwxr-xr-x 4 root wheel 512 Mar 9 17:15 common
[...]
> patch below will turn on caching on unionfs, and solve getcwd problem,
> patch against -CURRENT
> + if ((error == 0 || error == ENOENT) && saveflags & MAKEENTRY &&
> cnp->cn_nameiop != CREATE) {
This apparently doesn't want to work for -stable, with `saveflags'
causing a problem. Once I finish my -stable build, I'll see how
this changes the behaviour in -current. Thanks!
-*-
Hmmm, it has the same `saveflags' problem with my -current (from a few
days ago). Also, the first patch above, which worked well for me in
-stable, also seems to work for the getcwd() problem (csh, make) in
-current, but two minor problems remain --
* non-r00t users get errors as in -stable for missing directories
ls: share: Permission denied
ls: tools: Permission denied
ls: usr.bin: Permission denied
* existing directories show up twice in -current (not a problem
with -stable) with `ls -li' here:
41032 drwxr-xr-x 53 root wheel 512 Mar 10 22:22 sys
41032 drwxr-xr-x 53 root wheel 512 Mar 10 22:22 sys
41029 drwxr-xr-x 164 root wheel 512 Dec 27 03:10 usr.sbin
41029 drwxr-xr-x 164 root wheel 512 Dec 27 03:10 usr.sbin
(heh, I haven't checked to see how identical files in both layers
are handled)
Also, this is a unionfs mount atop a nullfs mount within the same
filesystem, /usr, /usr/local/system/src nullfs atop /usr/src, with
/usr/local/source-hacks unionfs atop the nullfs /usr/src, if it matters.
thanks,
barry bouwsma
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?200203102147.g2ALlDw00249>
