Auto mount remote URLs on FUSE lookup

The lookup function seems like the most natural place for auto mounting. It gets called at the beginning of every path resolution by the kernel. So any access into the kio-fuse tree will passes through lookup first, which makes it the right place to interceptd and mount a url on demand.

This implementation has two parts:

  1. Scheme folder: When the kernel looks up a name directly under the FUSE root and that name is a known KIO :internet protocol, an empty KIOFuseDirNode is created on the fly. This lets paths like /run/user/$UID/kio-fuse/smb/ exist as directories without requiring a prior mountUrl call.
  2. Authority automount: When kernel looks up a name under a scheme dir, the URL is reconstructed as scheme://authority from the path components and KIOFuseVFS::mountUrl is invoked internally. KIO::stat will trigger the password dialog if required.

Steps to test:

  1. The stable path MR must be in place with the correct QT_PLUGIN_PATH in the environment
  2. Open an smb share in dolphin
  3. Mount it in kio-fuse
  4. Open a source code file in vscode, then close vscode and reboot the machine
  5. Open vscode again. The share will be automounted and file will be open

Part of kde-linux/kde-linux#668

Edited by Nate Graham

Merge request reports

Loading
Loading