-
Notifications
You must be signed in to change notification settings - Fork 834
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
POSIX special files and NFS reparse points #1798
Comments
Hi @billziss-gh -- thanks for posting! Regarding NFS, though -- did you mean "NTFS"? As far as I know, WSL does not support NFS at all right now. I agree that it would be cool if WSL supported NFS special files, but I would personally like to see it support NFS regular files first :-) Are NFS special files especially important to you / to something that you do? If you did mean NTFS: WSL does actually support POSIX special devices on NTFS right now. But only in VolFs. VolFs is NTFS too. It's just making extensive (and, at times, fragile) use of NTFS features that are not broadly understood by most ordinary Windows applications. Do you have a specific need / use for broader support for POSIX special files other than symlinks in DrvFs? There are lots of things out there that the WSL team could implement. They seem to often prioritize the ones that would help the most people first. Regarding symlinks in DrvFs -- I for one wish they would get rid of the special WSL symlink reparse point and just use regular Windows symlinks. But that's already discussed on #559 . |
Actually I did mean NFS as in "Network File System". To clarify: with this issue I am not asking for NFS support; I am only offering Microsoft's own reparse points in NFS as a solution for POSIX special files. NFS Reparse Points can be implemented on top of any file system that supports reparse points (including of course NTFS). The reasons that I would like to see NFS Reparse Point support are the following:
This sounds desirable. However the problem is that Windows symlinks are quite different from POSIX ones, so I can see why the WSL folks might have chosen to take an alternative route. |
@billziss-gh Windows also does happen to support mounting NFS shares if you're on Pro or Enterprise, just for the record. |
@billziss-gh Just out of curiosity, what posix semantics do you see that would be problematic if WSL went with Windows symlinks per #1475? I did a port of nfs-fuse to Dokan a while back (message), and one of the (several) reasons I abandoned the idea was because Dokan doesn't appear to support symlinks. I didn't know about WinFsp at the time. [One of the other reasons was anyone wanting WSL/Win32 interop is going to expect FindFirstChangeNotification and inotify to work in both directions.] |
@fpqc thank you. I have no direct interest in NFS support for Windows. I think that perhaps the name of these "NFS reparse points" is distracting from my ask. Reparse points are a general mechanism for attaching special behavior to files on NTFS. Microsoft has used reparse points to add behavior like "mountpoints" (junctions) and "symbolic links" to NTFS and Windows. Microsoft also had to solve the problem of representing POSIX symbolic links and special files on Windows file systems before. They defined a form of reparse point, which they called "NFS reparse point" (likely because it emerged on NFS). This reparse point supports POSIX symbolic links, but also all common POSIX special files (LNK, CHR, BLK, FIFO, SOCK). This is the definition of NFS reparse points: https://msdn.microsoft.com/en-us/library/dn617178.aspx There is a proliferation of symbolic link solutions and it is not a good thing IMO. We have NTFS symlinks ( I would personally like to see one standard for POSIX symlinks on Windows. Although I can see why Microsoft would choose not to reuse NTFS symbolic links ( [There are many issues with NTFS symlinks, but one of the most important ones is that they can be set on both files and directories. In many cases NTFS will refuse to follow a file symlink that points to a directory or vice-versa. IMO this is an even bigger issue than the My apologies if you knew all that and you were just trying to point me to the right direction re: NFS. |
@therealkenc wrote:
As mentioned in my comment above, the biggest issue (IMO) is that an NTFS symbolic link can be either a directory or a file. The expectation is that symlinks pointing to directories have to be directories themselves and symlinks pointing to files have to be files themselves. This causes various problems. For example, you cannot create a symlink first and then the file/directory pointed by it (because you do not know whether to create the symlink as directory or file when the target does not exist). NTFS will in general refuse to follow symlinks that point to the wrong file type , although not consistently. Looking at some of the WinFsp code I see this comment: There is also the issue of
Fantastic! This has been on my interest list for a while. Would you like me to help fully port it to Windows? Drop me a note at the WinFsp project. |
ran course |
WSL should support all POSIX special files on DrvFs as NFS reparse points.
Microsoft already has documentation on implementing special files on NFS: https://msdn.microsoft.com/en-us/library/dn617178.aspx
However WSL currently supports only symbolic links on DrvFs. Furthermore they are implemented as a new form of reparse point with tag
0xa000001d
and the link target stored in the file's content.While I understand that NTFS symbolic links cannot adequately store POSIX targets, it is unclear why the existing NFS reparse points could not be used for WSL.
[My apologies for not following your issue template. This was posted accidentally while still being edited.]
The text was updated successfully, but these errors were encountered: