Replies: 6 comments 6 replies
-
|
Oh, and of course: |
Beta Was this translation helpful? Give feedback.
-
|
It is an interesting question. Intrigued (and easily distracted today) I looked at the Linux kernel and FreeBSD this morning. Linux kernelThe Linux Kernel seems quite clean in naming conventions, and uses And in different file system modules you can see how that value is modified as necessary, e.g. in OrangeFS, it seems there are Xattrs, but limited to ~8000 bytes: https://github.com/torvalds/linux/blob/5c8c229261f14159b54b9a32f12e5fa89d88b905/fs/orangefs/protocol.h#L187-L188
FreeBSDFreeBSD seems less clear. It mixes both:
FreeBSD doesn't seem to have clearer "this is the size" statements -- some clues to size being limitless, but beyond what i can reasonably read in the source. For Linux it describes the 65536 limit: https://github.com/freebsd/freebsd-src/blob/e3898d552c9807b523ab3b0a66056520aa2e252a/sys/compat/linux/linux_xattr.c#L45-L47 NotesInteresting comment in linux kernel ext4fs: https://github.com/torvalds/linux/blob/5c8c229261f14159b54b9a32f12e5fa89d88b905/fs/ext4/xattr.h#L72-L81 You asked about
|
Beta Was this translation helpful? Give feedback.
-
|
Awesome! Thanks for the links.
|
Beta Was this translation helpful? Give feedback.
-
|
Yesterday, btw i successfully stored a full JPG image (base64 encoded) as xattr on ZFS: The code in the Makefile shows a full-roundtrip example with MD5 validation 🌻 btw: If the xattr value is >64kB on ZFS, the error thrown by
(ext4 and btrfs say "out of diskspace") |
Beta Was this translation helpful? Give feedback.
-
|
There's a little information on MacOS and OSX here: https://stackoverflow.com/a/51518859 the arg list too long error here for MacOS seems to parallel XFS: https://apple.stackexchange.com/a/88760 Ah, that led me to the Darwin Kernel (I think) which I didn't realize was open source (til). Both XATTR max size (and name length) and Apple Doublefork lengths are described here: https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57b9f54c2f6d4a15585/bsd/sys/xattr.h#L72-L77 |
Beta Was this translation helpful? Give feedback.
-
Update on BTRFSThanks to replies on this thread by developers writing the linux-kernel docs for btrfs, the current insights are:
Details (thx @adam900710) on how much bytes /exactly/ can be used, are:
Formatting with larger nodesize:
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Good question.
Does anyone know a way to query "available xattr bytesize" for filesystem-handle XY (file/folder/object) - in code?
Is there anything in Python, like:
get_max_xattr_size()orget_free_xattr_space(filename)?Currently all I can find are short hints about "4k", "64k" or unlimited - depending on the filesystem and the parameters it was formatted/mounted with.
And I get an "out of diskspace" error when I try to write the IPTC international metadata image standard sample data to ext4.
Any insights or links to sources are greatly appreciated :)
TODO:
Put links here:
Beta Was this translation helpful? Give feedback.
All reactions