Basically there are two ways to implement this:
1. client lookup the filesystem root, and then walk the filesystem (based on the
subdirectory path) and instantiate the subdirectory as the mountpoint root.
This can be implemented entirely on the client and does not require any protocol
changes.
2. change the MDS_GETSTATUS RPC to pass the subdirectory pathname from the client
to the MDS, and have it do the pathname traversal locally and return the "root"
FID for the subdirectory. This needs protocol changes, though simple ones that
can be implemented in a backward-complatible manner.
The advantage of the first way is:
- no protocol changes.
- client changes only, no compatibility issue.
- pathname transversal is more convenient and natural in client, especially for CMD
which may involve several MDS.
Due to the above advantages this feature will be implemented in the first way.
However there are some limitations:
- <mountpoint>/.lustre doesn't exist for subdirectory mount. This '.lustre' directory
is maintained under root directory on MDS for whole filesystem. Though we may create
a link under subdirectory pointing to it, it may leak fids outside of its namespace.
Currently the only affected utility is lustre_rsync, but user can do a normal mount
and apply there (actually lustre_rsync should work on a normal mount, otherwise it
may not be able to access files out of its namespace).
- symlink in the subdirectory will not be supported due to the extra complexity.
The following part of code will be changed:
- llite mount transverse subdirectory path.
- `lfs fid2path` support subdirectory mount.
Scott
Thanks for drawing attention to this.
Lai
Kit has moved on to a new job. Could you please refresh the patch on his behalf?
Thanks
Peter