microsoft / microsoft/WSL

Plan9FileSystem hogging external USB drive with open handle

Open
#7,972 10 comments 20 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

Version

WSL version: 0.51.2.0 Kernel version: 5.10.81.1 WSLg version: 1.0.30 Windows version: 10.0.22000.434

WSL Version
  • WSL 2
  • WSL 1
Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

Don't know exactly how to reproduce, but right now there is a dllhost.exe having an open handle on D:\ (which is an external USB drive) and preventing it from ejecting.

It was started with the commandline C:\WINDOWS\system32\DllHost.exe /Processid:{DFB65C4C-B34F-435D-AFE9-A86218684AA8}, a registry search pointed to HKEY_CLASSES_ROOT\CLSID\{AFC7B6DE-D642-41B7-AB0C-A01019510741} which has an entry named Plan9FileSystem so it's probably WSL2 related.

image

The handle is still open after wsl --shutdown.

Expected Behavior

WSL2 file system bridge should not prevent external drives from ejecting

Actual Behavior

External drives cannot be ejected

Diagnostic Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified in the issue. Start by reviewing the Plan9FileSystem handle behavior and reproducing the external-drive eject problem with WSL 2, dllhost.exe, and wsl --shutdown. Done means the WSL 2 file system bridge no longer keeps the external drive handle open after shutdown.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.