-
Notifications
You must be signed in to change notification settings - Fork 846
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
FileStatLxInformation information class is used inconsistently for getting/setting mode/uid/gid #3865
Comments
@DHowett I am looking to implement Is the file system supposed to fill this value during |
@billziss-gh It is specified as |
@Biswa96 I understand. My question is whether the field is already filled in by NTOS when receiving |
To answer my own question, I have found that a file system driver must fill this information and it is not prefilled by NTOS. |
Migrated from #4022, because this one has the virtue of being a pretty valid question that remains open.
Some deductive reasoning can probably be applied. There are two possibilities I see:
You decide. WSL2 will already support FUSE, as announced, so there is nothing to "do" there. The killer FUSE app, That said, FUSE on Windows is still (incredibly) useful. Your query about setting WSL metadata (mode,uid:gid) is still completely valid, and will still be valid come WSL2. You want that. The Cygwin/MSYS2 people almost certainly want that. The ask is: "how do I do But that ask actually has little to do "with WSL", or how WSL goes about implementing the Linux syscall surface. You'll be fine, so long as your entirely valid question is answered, regardless of WSL2.
Yeah, it does, looked at from a certain angle. But if you can't beat em, join em. [True story: I took a look at what this guy was doing back in 2016 when WSL first came out to see "what would it take" but at the time (at least) the project wasn't far along enough to make any kind of run at it, and anyway, doing WSL2 in 2016 wasn't/isn't exactly a one man time-sink project, and I was kidding myself for looking except for the fun thought experiment.] |
To clarify my ask here had to do with making WinFsp file systems available as first class citizens under WSL1. I was able to figure this one out. (The important bits are support for extended attributes, My ask in #4022 is related to the fact that I have started working on real FUSE support for WSL1. This is not necessarily relevant to WinFsp (although it might become, I have not decided yet). For this purpose I started "researching" WSL1 and built a development kit for it which I was (until this morning) testing. The kit currently lets you write real character device drivers on WSL1 and I was planning to use it to implement Luckily I invested only about 2 weeks in this so far... |
Sadly I think you are right. And I say sadly because I found WSL1 genuinely interesting and innovative as a technology. |
Cool. Notable that no one ever built on this that I know of. Not even a
It's doable. You're going to have to take over |
Cool! I had been considering a number of approaches for this, but my preferred one might have been the following:
This would effectively expose a Linux FUSE file system to all of Windows. WSL1 would then mount the file system using The advantages of this approach were:
The obvious disadvantage of this approach is going through DrvFs to access a Linux FUSE file system. |
You can still do that (or something like it) in WSL2. The devs have basically traded making the Windows host side (generically speaking, call it the Microsoft side) presenting a Linux syscall surface in WSL1, to presenting a Linux KVM surface in WSL2. Or the analogy thereof. Based on the limited information out there right now, it looks like they've done virtio-9p. Or the analogy thereof. You want virtio-fs, which uses the fuse protocol instead of the 9P protocol. Or the analogy thereof. I call dibs on the first WSL2 bug report. Doing a |
Interesting. I have not followed Linux kernel developments in the past 10-15 years nor have I watched any of the new WSL2 presos. But yours are good pointers and I will follow up on them. |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
Your Windows build number: 18837, but I reckon this is true in 17763 as well.
What you're doing and what's happening:
What I am doing
Implementing a filesystem driver.
Querying a file
WSL will use
NtQueryInformationFile
(->IRP_MJ_QUERY_INFORMATION
) withFileStatLxInformation
to divine LX metadata from a file on drvfs/wslfs (v2). This works well enough.Creating a file
When creating a new file with
metadata=on
, it looks like WSL callsNtCreateFile
and passes anEaBuffer
containing the following extended attributes:$LXUID
$LXGID
$LXMOD
mknod(2)
as well)Updating a file
WSL emits an
IRP_MJ_SET_EA
setting the same extended attributes.It seems unusual to use
NtQueryInformationFile
for querying, but fall back to raw extended attributes for setting LX metadata.I would expect WSL to prefer
NtSetInformationFile
withFileStatLxInformation
and allow the actual extended attributes in use to remain an internal implementation detail.This complicates the implementation of a filesystem that doesn't use EAs to store uid/gid/mode.
The text was updated successfully, but these errors were encountered: