-
Notifications
You must be signed in to change notification settings - Fork 67
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
fs: properly handle ENOTSUP in copyXAttrs #245
fs: properly handle ENOTSUP in copyXAttrs #245
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fs/copy_linux.go
Outdated
xattrKeys, err := sysx.LListxattr(src) | ||
if err != nil { | ||
if err == unix.ENOTSUP { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Actually; this is handling an error returned by sysx
, which is not a raw stdlib / syscall package, perhaps better to use errors.Is()
here?
Some discussion with @robmry and @djs55 (we happened to be looking into a similar issue), and there's some discussion if EOPNOTSUPP
should be handled here; this was related to https://elixir.bootlin.com/linux/v6.10/source/fs/fuse/xattr.c#L23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps better to use errors.Is() here
Makes sense, pushed the change
there's some discussion if
EOPNOTSUPP
should be handled here
It seems pretty reasonable to me, since the fuse_getxattr
call would also fail in this use case. LMK and I can add add a check for this condition
Filesystems without xattr support do not have any xattrs to copy. The syscall for this will return ENOTSUP to indicate this, but continuity will treat it as a regular error. This change will return nil if this call returns ENOTSUP. Signed-off-by: David Son <[email protected]>
627d7a1
to
c494f3d
Compare
haven't had time to look deeper, but this CI test failure is strange; I don't think we have flakes in this project, so is this being caused by the change:
|
Please rebase to pass the CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging, assuming that the merge commit will pass the CI
Fixes #244. More context in the issue.
Filesystems without xattr support do not have any xattrs to copy. The syscall for this will return ENOTSUP to indicate this, but continuity will treat it as a regular error. This change will return nil if this call returns ENOTSUP.