Open ross-spencer opened 1 month ago
Where "user" is the (only) one currently assigned for arbitrary use (eg for annotation).
Quote: https://en.wikipedia.org/wiki/Extended_file_attributes#Linux
The name must be a null-terminated string prefixed by a namespace identifier and a dot character. [...]
The user namespace has no restrictions with regard to naming or contents. The system namespace is primarily used by the kernel for access control lists. The security namespace is used by SELinux, for example.
In the future, I imagine it'd make sense to apply for new namespaces for common annotation/structure needs, too. But for now, it's "user." for what we're doing here.
The actual naming (syntax) of attribute keys is (still) a good question.
I'd actually suggest to mix-and-match professionally. For example, for common properties, I'd check if there's an existing (standard) way of naming it.
I'd map common fields to existing popular/standard terms:
user.mercs.name
= user.org.dublincore.title
user.mp3.artist
= user.org.dublincore.creator
See Universal File System Extended Attributes Namespace (by Francois Revol / Haiku BFS) for additional information and examples regarding naming.
MacOS uses a reverse-DNS-like notation (like Java classes or RDF), which seems noisy at first - but makes sense over time.
So for custom properties, I'd rather suggest an "origin domain" prefix than app-name:
user.com.ahalodeck.awesomeness = 100+
That's actually the beauty of this: It's a mix-and-match and then filter/map on demand.
A good question is the string-length of the keynames: because ext4 has a "inode blocksize" limit on the total size of all keys+values to store xattrs.
I'm torn: I think it makes sense to get used to a proper, sustainable wording of keys (see EA-UXA article by Francois above) - but it may also be good to start with something that works on as many filesystems that are common right now (eg ext4 vs btrfs).
So I'm also suggesting "mapping-objects" to easily support (shorter) aliases for keys. (another story)
btw: I just found that Apache Hadoop's filesystem "HDFS" has an article about xattrs and namespaces in their official docs:
https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/ExtendedAttributes.html
Are all xattrs usually prefixed with
user
e.g.user.checksum
? ref: https://wiki.archlinux.org/title/Extended_attributesAnd should there be a further prefix for this app when they're set by it, e.g.
user.mercs.YYYY
?