From 7b0068180772b9dd7e0b00ca9e1b0f3ce39c9c23 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 15 May 2018 23:00:47 +0200 Subject: xattr: return EOPNOTSUPP for unsupported attributes mv is unhappy when we return EPERM when it tries to set system.posix_acl_access: mv: preserving permissions for ‘b/x’: Operation not permitted Now we return EOPNOTSUPP like tmpfs does and mv seems happy. --- internal/fusefrontend/xattr.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal/fusefrontend') diff --git a/internal/fusefrontend/xattr.go b/internal/fusefrontend/xattr.go index ac4b15f..813f286 100644 --- a/internal/fusefrontend/xattr.go +++ b/internal/fusefrontend/xattr.go @@ -48,13 +48,15 @@ func (fs *FS) GetXAttr(path string, attr string, context *fuse.Context) ([]byte, return data, fuse.OK } +const _EOPNOTSUPP = fuse.Status(syscall.EOPNOTSUPP) + // SetXAttr implements pathfs.Filesystem. func (fs *FS) SetXAttr(path string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status { if fs.isFiltered(path) { return fuse.EPERM } if disallowedXAttrName(attr) { - return fuse.EPERM + return _EOPNOTSUPP } flags = filterXattrSetFlags(flags) @@ -74,7 +76,7 @@ func (fs *FS) RemoveXAttr(path string, attr string, context *fuse.Context) fuse. return fuse.EPERM } if disallowedXAttrName(attr) { - return fuse.EPERM + return _EOPNOTSUPP } cPath, err := fs.getBackingPath(path) if err != nil { -- cgit v1.2.3