|
Namespace Crossings for Plan 9The Current SituationCurrently, in Plan 9, all namespaces are isolated from each other. This is, indeed, how Plan 9 achieves most of its security. However, this can pose a problem at times.
This project is an experiment in solving the first issue, though it might provide insight into alternative mechanisms useful for the others. ApproachThe #p device driver,
traditionally mounted on We could add a BackgroundA file descriptor is backed by a structure called a A channel also includes a Path,
which is a list of mountpoints crossed to reach the current point in the
hierarchy.
The Plan 9 "dot-dot" paper
has more about how this actually works, but perhaps a short example
will suffice.
Since servers can be queried for the parent of any directory,
but obviously don't know about namespaces,
Namespaces (that is, the hierarchy of servers) are stored in a structure called a Pgrp. A namespace consists of a binding of "left hand side"s to one or more "right hand side"s (a "union mount" occurs when one "left hand side" maps to several "right hand side"s). ImplementationThe prototype alters the namespace code so that The general flow is then:
Current StatusThe prototype functions well enough to support a demo! This screenshot shows the bottom window visiting the namespace of the top window. Each window displays a list of filenames appearing in square brackets; this is the result of requesting a filename-completion, and demonstrates that rio has been patched to perform completion with respect to each window's namespace. The changes are available in diff format or in annotated form offsite. Shortcomings
Future WorkThis patch as it stands is not scheduled for submission to the Plan 9 distribution. While it "works" in some sense, it is not entirely obvious what the desirable behavior is in all cases (should a process in one namespace be able to make changes in another namespace?). In addition, thinking after the dust settled suggests it might be structurally cleaner to approach the problem by slightly altering the definition of a namespace. Currently, each process specifies its namespace ( It would seem attractive for the root to be a namespace property rather than a process property. Then it would be possible for a kernel server to present userland with two views of a namespace: an unordered list of bindings and a walkable hierarchy of file servers. While it would be possible to expose the "mount-table view" the way things stand, it is not entirely clear what names to give the bindings in absence of a well-defined root; moving the root into the namespace is necessary to expose the server-hierarchy view. This approach would allow the namespace-crossing code to be a
separate device driver essentially independent of ConclusionNamespaces are a core service of the Plan 9 kernel, so any changes in this area are tricky to specify and implement. Hopefully the extended functionality demonstrated by this project will spark discussion about what should be done and how it might best be accomplished. | ||||||||
[Last modified Monday March 26, 2007] |