Skip to content

fix: retry xattr.List on ERANGE/E2BIG - #717

Merged
aduffeck merged 3 commits into
opencloud-eu:mainfrom
rhafer:retry-xattr-list
Jul 1, 2026
Merged

aduffeck merged 3 commits into
opencloud-eu:mainfrom
rhafer:retry-xattr-list

Conversation

@rhafer

@rhafer rhafer commented Jun 30, 2026

Copy link
Copy Markdown
Member

xattr.List is not atomic: it issues one listxattr syscall to size the name list, then a second to read it into a buffer sized from the first. If a concurrent writer adds an extended attribute between the two calls, the second listxattr overflows the buffer and the kernel returns ERANGE ("numerical result out of range"). The posix fs watcher hits this when it assimilates a node while it is still being created, surfacing as random test failures and failed assimilations.

Wrap xattr.List in listXattr, which retries on these transient range errors, and use it in the hybrid and xattrs backends.

@rhafer
rhafer requested a review from aduffeck June 30, 2026 12:31
@rhafer rhafer self-assigned this Jun 30, 2026
rhafer added 2 commits June 30, 2026 14:42
xattr.List is not atomic: it issues one listxattr syscall to size the
name list, then a second to read it into a buffer sized from the first.
If a concurrent writer adds an extended attribute between the two calls,
the second listxattr overflows the buffer and the kernel returns ERANGE
("numerical result out of range"). The posix fs watcher hits this when it
assimilates a node while it is still being created, surfacing as random
test failures and failed assimilations.

Wrap xattr.List in listXattr, which retries on these transient range
errors, and use it in the hybrid and xattrs backends.
@rhafer
rhafer force-pushed the retry-xattr-list branch from ce7792d to c24029c Compare June 30, 2026 12:43

@aduffeck aduffeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (I would just prefer the spdx identifier for the license)

Co-authored-by: Andre Duffeck <aduffeck@users.noreply.github.com>
@aduffeck
aduffeck merged commit 898d8f0 into opencloud-eu:main Jul 1, 2026
18 of 19 checks passed
@openclouders openclouders mentioned this pull request Jun 30, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants