mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cephfs: upgrade fscrypt version to fix concurrency issue
In older versions of fscrypt there is a race condition when multiple encrypted cephfs instances are deployed simultaneously. Signed-off-by: NymanRobin <robin.nyman@est.tech>
This commit is contained in:
6
vendor/github.com/google/fscrypt/metadata/config.go
generated
vendored
6
vendor/github.com/google/fscrypt/metadata/config.go
generated
vendored
@ -21,9 +21,9 @@
|
||||
// Package metadata contains all of the on disk structures.
|
||||
// These structures are defined in metadata.proto. The package also
|
||||
// contains functions for manipulating these structures, specifically:
|
||||
// * Reading and Writing the Config file to disk
|
||||
// * Getting and Setting Policies for directories
|
||||
// * Reasonable defaults for a Policy's EncryptionOptions
|
||||
// - Reading and Writing the Config file to disk
|
||||
// - Getting and Setting Policies for directories
|
||||
// - Reasonable defaults for a Policy's EncryptionOptions
|
||||
package metadata
|
||||
|
||||
import (
|
||||
|
2
vendor/github.com/google/fscrypt/metadata/metadata.pb.go
generated
vendored
2
vendor/github.com/google/fscrypt/metadata/metadata.pb.go
generated
vendored
@ -23,7 +23,7 @@
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v3.6.1
|
||||
// source: metadata/metadata.proto
|
||||
|
||||
|
13
vendor/github.com/google/fscrypt/metadata/policy.go
generated
vendored
13
vendor/github.com/google/fscrypt/metadata/policy.go
generated
vendored
@ -28,6 +28,7 @@ import (
|
||||
"os"
|
||||
"os/user"
|
||||
"strconv"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
@ -85,6 +86,15 @@ func (err *ErrDirectoryNotOwned) Error() string {
|
||||
write access to the directory.`, err.Path, owner)
|
||||
}
|
||||
|
||||
// ErrLockedRegularFile indicates that the path is a locked regular file.
|
||||
type ErrLockedRegularFile struct {
|
||||
Path string
|
||||
}
|
||||
|
||||
func (err *ErrLockedRegularFile) Error() string {
|
||||
return fmt.Sprintf("cannot operate on locked regular file %q", err.Path)
|
||||
}
|
||||
|
||||
// ErrNotEncrypted indicates that the path is not encrypted.
|
||||
type ErrNotEncrypted struct {
|
||||
Path string
|
||||
@ -164,6 +174,9 @@ func buildV2PolicyData(policy *unix.FscryptPolicyV2) *PolicyData {
|
||||
func GetPolicy(path string) (*PolicyData, error) {
|
||||
file, err := os.Open(path)
|
||||
if err != nil {
|
||||
if err.(*os.PathError).Err == syscall.ENOKEY {
|
||||
return nil, &ErrLockedRegularFile{path}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
Reference in New Issue
Block a user