Skip to content
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

Support more/larger xattrs? (now = "no space left on device") #127176

Open
pjotrek-b opened this issue Nov 22, 2024 · 1 comment
Open

Support more/larger xattrs? (now = "no space left on device") #127176

pjotrek-b opened this issue Nov 22, 2024 · 1 comment
Labels
type-bug An unexpected behavior, bug, or error

Comments

@pjotrek-b
Copy link

pjotrek-b commented Nov 22, 2024

Bug report

Bug description:

When trying to copy all embedded metadata key/value information from the IPTC standard-reference image, I get the following error:

[Errno 28] No space left on device: 'xattr-write-target-filename'

os.setxattr(target, prefix + strkey, strval.encode())

The total size of the exiftool-json is 15kB. More than 4k, but:

On kernel.org Wiki (ext4:xattrs), it says:

The paragraph is titled "Large Extended Attribute Values":

To enable ext4 to store extended attribute values that do not fit in the inode or in the single extended attribute block attached to an inode, the EA_INODE feature allows us to store the value in the data blocks of a regular file inode. This “EA inode” is linked only from the extended attribute name index and must not appear in a directory entry.

So I guess ext4 should be able to handle it?
My code works fine for writing shorter/less xattrs.

Does my blocksize matter? (512 bytes)
Is there any way to check what the limit is?
And which component in the stack actually decides this "out of diskspace" error?

Thank you very much in advance 😄
(PS: This was on Xubuntu 20.04.6 - python 3.8.10. Wasn't available in the dropdown)

CPython versions tested on:

3.8.10

Operating systems tested on:

Linux

@pjotrek-b pjotrek-b added the type-bug An unexpected behavior, bug, or error label Nov 22, 2024
@ronaldoussoren
Copy link
Contributor

Have you tried setting the xattr using the fsetfattr(1) command-line tool? If that results in the same error this is a limitation in linux or ext4.

My reading of https://man7.org/linux/man-pages/man5/ext4.5.html is that EA_INODE is enabled by a filesystem feature flag, the file system your testing on likely does not have the feature enabled. Tune2fs can enable this feature (according to its manage), but cannot disable it. I've no idea if enabling this feature can have side effects that cause problems in other software, so please test carefully before enabling on a filesystem with important data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants