You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows 10.0.14393, directories on VolFS that contain hardlink targets cannot be moved shortly after the hardlink is created. This breaks the build process for Chromium (for example), as glibc_arm.tgz contains this structure.
To reproduce, create a hardlink in your home directory from b/2 to a/1 and then try to rename a to ax:
$ mkdir a b
$ touch a/1
$ ln a/1 b/2
$ mv a{,x}
mv: cannot move ‘a’ to ‘ax’: Permission denied
The mv here should not fail. If you exit all WSL windows and open bash again, it succeeds, suggesting the issue is related to internal state or caching. You must exit WSL after the ln step: if you exit before this step it still fails.
Renaming a/1 or b/2 doesn't make a difference, but after renaming b (even if renamed back again), it will succeed within the same session:
I've installed 14965 using the ISO as I didn't receive anything through the upgrade mechanism, and I can still reproduce this issue. Did you reproduce the issue on 14393?
I've downgraded back to 14393 as Chrome kept crashing and there are no kernel symbols for that build on the public server. It turns out the error is a 0xc0000022 status from this call, which is turned into -EACCES:
SetInformationFile is passed FileRenameInformation, and the documentation calls out the following failure case:
A directory cannot be renamed if it or any of its subdirectories contains a file that has open handles (except in the batch-oplock case described earlier).
After running the repro case there are indeed open handles on both a/1 and b/2, annoyingly owned by the System process. The handles are the same on each failing call to LxpUtilRenameFileByHandle, but can be closed by the workarounds I mentioned before:
This last one shows there's a VfsDirectoryEntryCache, and that the cache has a limited size.
Without digging into the code, my guess is that VolFs resolves both paths to the same inode, which is then mapped to the same file handle twice, causing a temporary leak (after opening by path when creating the hardlink).
Can't reproduce this on recent WSL1, where "recent" was probably circa the 9p filesystem changes that happened in 18362. If a similar problem persists don't hesitate to open a new issue.
Activity
[-]VoIFs cross-directory hardlink cache bug[/-][+]Permission denied renaming VoIFs hardlink directory[/+]jackchammons commentedon Nov 28, 2016
I am unable to reproduce this on build 14965.
Mark Steward (@marksteward) could you upgrade to a recent insider build of Windows and confirm that this issue is fixed?
marksteward commentedon Nov 28, 2016
I've now enrolled but I guess it'll be a few days before I can confirm. Thanks!
marksteward commentedon Dec 3, 2016
I've installed 14965 using the ISO as I didn't receive anything through the upgrade mechanism, and I can still reproduce this issue. Did you reproduce the issue on 14393?
[-]Permission denied renaming VoIFs hardlink directory[/-][+]Permission denied renaming VolFs hardlink directory[/+]marksteward commentedon Dec 4, 2016
I've downgraded back to 14393 as Chrome kept crashing and there are no kernel symbols for that build on the public server. It turns out the error is a 0xc0000022 status from this call, which is turned into -EACCES:
SetInformationFile is passed FileRenameInformation, and the documentation calls out the following failure case:
After running the repro case there are indeed open handles on both a/1 and b/2, annoyingly owned by the System process. The handles are the same on each failing call to LxpUtilRenameFileByHandle, but can be closed by the workarounds I mentioned before:
du -shx /:This last one shows there's a VfsDirectoryEntryCache, and that the cache has a limited size.
Without digging into the code, my guess is that VolFs resolves both paths to the same inode, which is then mapped to the same file handle twice, causing a temporary leak (after opening by path when creating the hardlink).
sunilmut commentedon Dec 6, 2016
Sven Groot (@SvenGroot) as FYI
marksteward commentedon Dec 8, 2016
Is this still unreproducible? Should I spend some time this weekend seeing if it's something weird on my machine?
marksteward commentedon Jan 1, 2017
I can still reproduce this on build 14986 in a VM - can I suggest removing the fixedininsiderbuilds tag?
dontsave commentedon Jan 2, 2017
I can also confirm this is happening in 14986. It's been causing npm installs to fail in my environment. Solution is to reboot the terminal
marksteward commentedon Jan 2, 2018
Still happening in 16299.
therealkenc commentedon Aug 19, 2020
Can't reproduce this on recent WSL1, where "recent" was probably circa the 9p filesystem changes that happened in 18362. If a similar problem persists don't hesitate to open a new issue.