On 9/26/22 15:25, Joel Holdsworth (@jhol) wrote:
The trouble is that while we want to seamlessly integrate with the underlying filesystems, the availability of different methods varies between operating systems and filesystems. This version of the patch set offers three strategies, and I found a two more possible methods that should be added today ([1](https://man7.org/linux/man-pages/man2/ioctl_iflags.2.html) [2](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/n...) ).
The code attempts to store the flags by all available methods at once for a given file, and ORs the flags together from any available source, in the hopes we can deliver the most complete coverage to the user.
However, because there is no fallback method, it is currenly not possible to guaruantee that the attributes will always be stored and retrieved correctly in all scenaries.
If we only include the first four patches, the patch set will only support storage in Samba-formatted Extended File Attributes. If we unmark the associated test cases as `todo_wine`, the test will break on certain operating systems or certain mount flag choices. There is no support for Extended Attributes on FreeBSD or NetBSD, for example, and the MacOS Extended Atrribute APIs differ from the Linux ones.
Sure, I understand the concern. That said, currently they're broken on *all* platforms, and so I don't think it's necessarily a problem to effectively fix them on one platform at a time.
One approach is to fall back to using a `.dosattributes` directory when no other storage method is available, and store the attributes in files inside there. However, I didn't want to implement this functionality before having a conversation with the Wine project developers.
That's a good question, and one I don't think I have enough knowledge to answer. My gut is that if extended attributes are "universal enough" (and usable enough), and we can easily implement DOS attributes over them, modulo slight differences in the API, then there isn't really any need to implement something truly portable. I could be wrong about this, though.
Regardless I think now is a good time to have such a conversation :-)
There is also the storage of [NT extended-attribute (EA)](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntif...) values to consider, when we move toward a non-stub implementation of this feature.
Perhaps it would be preferable to produce a design that can be encompass all these issues.
I don't have a good read on this, personally. I suppose it at least partly depends on whether NT extended attributes are used by any program. I'm at least not aware of any usage?
Do we need to resolve this design question here and now? Or can we just proceed with Linux-only Extended Attributes in the short term?
I think working out the design completely before submitting any patches would probably be a good idea.
One practical question. How do I make the test case `todo_wine` in some cases, an not in others? Do I just have to comment out the test? Or is there a trick to indicate that inconsistency between plaforms is expected?
With respect to different platforms that Wine may be run on, that's not something we've as yet really concerned ourself with. Of course, that's largely because nobody runs the tests on anything but Linux, but regardless, I don't think it's going to be a problem if tests fail temporarily on other platforms. I would place todo_wine annotations according to the Linux test failures (and specifically the gitlab CI test failures, not that I expect it to matter).