Merge pull request #459 from versity/ben/posix_check

feat: check for xattr support on posix init
This commit is contained in:
Ben McClelland
2024-03-14 09:31:13 -07:00
committed by GitHub

View File

@@ -74,6 +74,12 @@ func New(rootdir string) (*Posix, error) {
return nil, fmt.Errorf("open %v: %w", rootdir, err)
}
_, err = xattr.FGet(f, "user.test")
if errors.Is(err, syscall.ENOTSUP) {
f.Close()
return nil, fmt.Errorf("xattr not supported on %v", rootdir)
}
return &Posix{rootfd: f, rootdir: rootdir}, nil
}