Reconnecting to session causes duplicate drive entries in fuse fs #1299
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First time I connect, I get remote drives as expected in ~/thinclient_drives :-
If I disconnect and reconnect immediately, these drives get duplicated, according to ls:-
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
calledxfuse_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?