-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: Stat fails on NTFS volumes with Deduplication enabled #10935
Comments
@NTmatter would you like to send a fix for this? You seems to know all about these file types. See http://golang.org/doc/contribute.html for details. If not, I will fix it myself. Alex |
I can take a stab at it if you don't have enough bandwidth. It'll probably be a few days before I can get a proper dev and test environment together, depending on my workload. |
Please try to fix this. I don't know much about any of this and don't really want to learn. But happy to review your code. I can test your code if you don't have appropriate environment setup. Good new test will make our task much easier, considering I know little about the subject. Test that breaks with current tip, but PASSes once your changes are applied. No pressure. I will do it myself, if you cannot do it. Thank you. Alex |
I've got a basic dev environment running now. Should be possible to start looking at it in the next day or two :) |
Took a bit longer than expected, but a small change set is up for review at https://go-review.googlesource.com/11330/ |
CL https://golang.org/cl/11330 mentions this issue. |
CL https://golang.org/cl/41504 mentions this issue. |
CL https://golang.org/cl/41834 mentions this issue. |
os.Stat("Path\to\deduped.file")
err := "readlink Path\to\deduped.file: The system cannot find the file specified."
From a bit of digging, the issue is caused by NTFS Dedupe using reparse points for deduplicated files. The Windows implementation of fileStat.Mode() treats all reparse points as symlinks, however there are several other cases to consider, including Deduplication and Mount Points, neither of which are symlinks.
The Windows implementation of os.Readlink() already performs a sanity check to ensure that it is handling a symlink. Ideally a similar inspection could be performed in Mode(), checking for
IO_REPARSE_TAG_DEDUP == 0x80000013
and stripping the Symlink flag, allowing the file to be treated as Regular.The text was updated successfully, but these errors were encountered: