Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnecting to session causes duplicate drive entries in fuse fs #1299

Merged

Conversation

matt335672
Copy link
Member

First time I connect, I get remote drives as expected in ~/thinclient_drives :-

$ ls ~/thinclient_drives/
J:  P:  R:  S:  T:  U:

If I disconnect and reconnect immediately, these drives get duplicated, according to ls:-

$ ls ~/thinclient_drives/
J:  J:  P:  P:  R:  R:  S:  S:  T:  T:  U:  U:

Interestingly this duplication is not visible in the GNOME file manager on CentOS.

I've had a look at the code, and it seems the duplication is happening as the fuse inode cache is never cleared. When the user reconnects, the shared drives are being set up again in the fuse inode cache.

If the user reconnects with the same drives, the only visible effect is the drive letter duplication. If however the user reconnects from a differently configured Windows client, the drives may have different letters and/or device numbers. Trying to access missing drives causes the application issuing the access request to hang.

The safest thing is to clear down the fuse inode cache on a disconnect. At this point the fuse filesystem is unmounted anyway.

There's a stub routine in chansrv_fuse.c called xfuse_deinit_xrdp_fs() which is supposed to do precisely this, but has never been implemented. This PR adds an implementation and moves the call to the routine until after the fuse system has been unmounted, so that we can be sure nothing in the inode cache is relevant any more.

Does anyone have any idea why xfuse_deinit_xrdp_fs() was never implemented?

@metalefty
Copy link
Member

Good catch. I'm not sure why deinit was not implemented.

@metalefty metalefty merged commit dea3408 into neutrinolabs:devel Mar 8, 2019
@matt335672 matt335672 deleted the clear-drives-on-disconnect branch April 11, 2019 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants