EOPNOTSUPP can be returned if the filesystem does not support xattrs (#5344)

---------

Co-authored-by: Greg Oster <oster@netbsd.org>
This commit is contained in:
gregoster
2025-09-05 13:09:27 -06:00
committed by GitHub
parent e98c44baaf
commit 839c38b4c4
2 changed files with 9 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
Bugfix: Ignore EOPNOTSUPP as an error for xattr
Restic 0.18.0 added xattr support for NetBSD 10+, but not all NetBSD
filesystems support xattrs. Other BSD systems can likewise return
EOPNOTSUPP, so restic now simply ignores EOPNOTSUPP errors for xattrs.
https://github.com/restic/restic/issues/5344

View File

@@ -53,9 +53,8 @@ func handleXattrErr(err error) error {
case *xattr.Error: case *xattr.Error:
// On Linux, xattr calls on files in an SMB/CIFS mount can return // On Linux, xattr calls on files in an SMB/CIFS mount can return
// ENOATTR instead of ENOTSUP. // ENOATTR instead of ENOTSUP. BSD can return EOPNOTSUPP.
switch e.Err { if e.Err == syscall.ENOTSUP || e.Err == syscall.EOPNOTSUPP || e.Err == xattr.ENOATTR {
case syscall.ENOTSUP, xattr.ENOATTR:
return nil return nil
} }
return errors.WithStack(e) return errors.WithStack(e)