EOPNOTSUPP can be returned if the filesystem does not support xattrs#5344
EOPNOTSUPP can be returned if the filesystem does not support xattrs#5344MichaelEischer merged 4 commits intorestic:masterfrom
Conversation
internal/fs/node_xattr.go
Outdated
| // ENOATTR instead of ENOTSUP. Ignore "Operation not supported" | ||
| // as well. |
There was a problem hiding this comment.
ENOTSUP is "Operation not supported"; EOPNOTSUPP is "Operation not supported on socket". So I think this comment should call out NetBSD for being weird:
| // ENOATTR instead of ENOTSUP. Ignore "Operation not supported" | |
| // as well. | |
| // ENOATTR instead of ENOTSUP. NetBSD can return EOPNOTSUPP. |
There was a problem hiding this comment.
From the Linux errno manpage xD . Although, I agree that NetBSD shows some rather unusual behavior here.
(ENOTSUP and EOPNOTSUPP have the same value on Linux, but according to POSIX.1 these error values should be distinct.)
There was a problem hiding this comment.
The xattr package for go:
https://github.com/pkg/xattr/blob/master/xattr_test.go
uses both ENOTSUP and EOPNOTSUPP as well. FreeBSD (I think) will be the same as NetBSD in terms of returning EOPNOTSUPP. Not sure about Darwin.
There was a problem hiding this comment.
EOPNOTSUPP seems indeed to be a BSD thing: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/acl_set.3.html . Although, restic has supported xattrs on darwin, freebsd, linux and solaris for quite a while, and there haven't been any reports regarding that error code. But feel free to replace NetBSD with BSD in the above suggestion.
|
@gregoster are you still interested in completing the PR? |
Yes, I'd still like this completed. I've merged in the suggested wording changes. Is there anything else required? |
f3e3b05 to
c631d3e
Compare
MichaelEischer
left a comment
There was a problem hiding this comment.
LGTM.
I've rebased the PR to get rid of the merge commit.
On Linux, ENOTSUP and EOPNOTSUPP have the same value such that Go does not allow adding them to the same case.
…estic#5344) --------- Co-authored-by: Greg Oster <oster@netbsd.org>
What does this PR change? What problem does it solve?
EOPNOTSUPP is returned on NetBSD on non-FFSv2ea filesystems, and possibly on other OSes with filesystems which do not support xattrs. This patch ignores EOPNOTSUPP as an error for xattr.
Was the change previously discussed in an issue or on the forum?
#5341
Checklist
changelog/unreleased/that describes the changes for our users (see template).