# os: Stat fails on NTFS volumes with Deduplication enabled #10935

Closed
opened this issue May 22, 2015 · 8 comments
Closed

# os: Stat fails on NTFS volumes with Deduplication enabled#10935

opened this issue May 22, 2015 · 8 comments
Labels
Milestone

### NTmatter commented May 22, 2015

 Go Version: go1.4.2 windows/amd64 OS and Arch: Windows 8.1 Pro 64-bit. Action: os.Stat("Path\to\deduped.file") Expected Result: successfully returns (FileInfo, nil) Actual Result: 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.
mentioned this issue May 22, 2015
added the label May 23, 2015
changed the title Stat() fails on NTFS volumes with Deduplication enabled os: Stat() fails on NTFS volumes with Deduplication enabled May 23, 2015

### alexbrainman commented May 31, 2015

 @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

### NTmatter commented Jun 2, 2015

 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.
added this to the Go1.5Maybe milestone Jun 3, 2015

### alexbrainman commented Jun 3, 2015

 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

### NTmatter commented Jun 3, 2015

 I've got a basic dev environment running now. Should be possible to start looking at it in the next day or two :)

### NTmatter commented Jun 22, 2015

 Took a bit longer than expected, but a small change set is up for review at https://go-review.googlesource.com/11330/

### gopherbot commented Jun 24, 2015

 CL https://golang.org/cl/11330 mentions this issue.
modified the milestones: Go1.6Early, Go1.5Maybe Jul 21, 2015
changed the title os: Stat() fails on NTFS volumes with Deduplication enabled os: Stat fails on NTFS volumes with Deduplication enabled Jul 21, 2015
modified the milestones: Go1.6, Go1.6Early Dec 11, 2015
modified the milestones: Unplanned, Go1.6 Jan 7, 2016
mentioned this issue Apr 14, 2017

### gopherbot commented Apr 25, 2017

 CL https://golang.org/cl/41504 mentions this issue.

### gopherbot commented Apr 29, 2017

 CL https://golang.org/cl/41834 mentions this issue.
closed this in  5300362  May 7, 2017
mentioned this issue May 16, 2017
locked and limited conversation to collaborators May 7, 2018
added the label May 7, 2018