LinuxCIFS Multisession Mount
This page is a design document for adding multisession capability to the Linux CIFS client.
Currently each mount with the Linux CIFS client is a single-user affair. That is, each mount uses a single set of credentials. Any user does operations within that mount uses the same set of credentials.
The exception to this rule is the "MultiuserMount" switch. When that is enabled, the client will try to match the uid of the current process with an existing mount to the same server and then will use that session's credentials instead. The upshot here is that if you mount the same share multiple times with different uid= and different credentials then you can allow different users to use different credentials.
There are problems with this approach though:
- it's extremely cumbersome to implement
- when a matching session isn't found, it uses the "default" session for the mount anyway
- multiple mounts means that caches aren't properly shared
...as well as other issues. We'd like to see this fixed
Overview of the Goal
Allow a single mountpoint to spawn SMB sessions on the fly. When a "new" user walks into a mount, CIFS will establish a new SMB session on the fly. It will get credentials out of the keyring and then spawn a new SMB session and perform a tree connect for that user. The operations will then be done using the correct smb session and tcon for that uid.
Eventually, the list of sessions will be pruned (probably by cifsd closing out unused sessions after a timeout).