Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/mntgen_through_exportfs/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


i believe i mentioned this issue to russ some time ago:
when mntgen is used behind exportfs, the mount points get "lost",
as exportfs does not hold an open file descriptor for each
directory that has been walked to by its clients, so walking
to a file below the mount point results in mntgen creating a new
mountpoint with a new qid, so "forgetting" the old mount.

reproduce the problem with:

	mkdir /tmp/mnttest
	mntgen /tmp/mnttestsrvfs
	srvfs mnttest /tmp/mnttest

	[in another window]
	mount /srv/mnttest /tmp
	bind /dev /tmp/blah
	ls -l /tmp/blah

a deeper fix might change the plan 9 kernel to allow
user processes to hold file descriptors that are not
yet open (but may be walked). that fix doesn't seem so
likely in the near future (and it's not a great problem for
anything else), so this fix changes mntgen so it always
generates the same qid (60 bits of md5sum) for a given mountpoint
name, thus avoiding the problem.

it's a small enough change that i hope it can be accepted for
the time being, even if it is only an interim solution to a
deeper problem...

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].