Skip to content

Conversation

@corhere
Copy link
Contributor

@corhere corhere commented Jan 22, 2024

The names of extended attributes are not completely freeform. Attributes are namespaced, and the kernel enforces (among other things) that only attributes whose names are prefixed with a valid namespace are permitted. The name of the attribute therefore needs to be known in order to diagnose issues with lsetxattr. Include the name of the extended attribute in the errors returned from the Lsetxattr and Lgetxattr so users and us can more easily troubleshoot xattr-related issues. Include the name in a separate rich-error field to provide code handling the error enough information to determine whether or not the failure can be ignored.

- What I did

- How I did it

- How to verify it

- Description for the changelog

  • To assist in troubleshooting, the name of the xattr which could not be set is now reported in error messages

- A picture of a cute animal (not mandatory but encouraged)

The names of extended attributes are not completely freeform. Attributes
are namespaced, and the kernel enforces (among other things) that only
attributes whose names are prefixed with a valid namespace are
permitted. The name of the attribute therefore needs to be known in
order to diagnose issues with lsetxattr. Include the name of the
extended attribute in the errors returned from the Lsetxattr and
Lgetxattr so users and us can more easily troubleshoot xattr-related
issues. Include the name in a separate rich-error field to provide code
handling the error enough information to determine whether or not the
failure can be ignored.

Signed-off-by: Cory Snider <csnider@mirantis.com>
@corhere corhere added area/builder Build kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. process/cherry-pick/25.0 labels Jan 22, 2024
@corhere corhere added this to the 26.0.0 milestone Jan 22, 2024
@corhere corhere requested a review from thaJeztah January 22, 2024 20:46
@corhere corhere requested a review from tonistiigi as a code owner January 22, 2024 20:46
Comment on lines +29 to 32
case *os.PathError:
err.Path = cleanpath
case *system.XattrError:
err.Path = cleanpath
Copy link
Member

Choose a reason for hiding this comment

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

Was about to comment these could be combined in a single case, but .. that's not possible with type matching. fun!

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/builder Build kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. process/cherry-picked status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants