Skip to content

Commit

Permalink
fuse: move conflict opcodes into linux specific build
Browse files Browse the repository at this point in the history
`CAP_SETXATTR_EXT,CAP_INIT_EXT,CAP_INIT_RESERVED` opcodes conflicts with
osxfuse `CAP_CASE_INSENSITIVE,CAP_VOL_RENAME,CAP_XTIMES` opcodes,
that's causing panic, so it should be moved into linux specific build.

Change-Id: I0916ea0bd2c169a0aa1f654ef015799fa0e5084e
  • Loading branch information
dsxack committed Nov 10, 2023
1 parent 1aa7b7b commit aab5a0d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 0 additions & 3 deletions fuse/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ var (
CAP_MAP_ALIGNMENT: "MAP_ALIGNMENT",
CAP_SUBMOUNTS: "SUBMOUNTS",
CAP_HANDLE_KILLPRIV_V2: "HANDLE_KILLPRIV_V2",
CAP_SETXATTR_EXT: "SETXATTR_EXT",
CAP_INIT_EXT: "INIT_EXT",
CAP_INIT_RESERVED: "INIT_RESERVED",
CAP_SECURITY_CTX: "SECURITY_CTX",
CAP_HAS_INODE_DAX: "HAS_INODE_DAX",
CAP_CREATE_SUPP_GROUP: "CREATE_SUPP_GROUP",
Expand Down
3 changes: 3 additions & 0 deletions fuse/print_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ func init() {
openFlagNames.set(syscall.O_DIRECT, "DIRECT")
openFlagNames.set(syscall.O_LARGEFILE, "LARGEFILE")
openFlagNames.set(syscall_O_NOATIME, "NOATIME")
initFlagNames.set(CAP_SETXATTR_EXT, "SETXATTR_EXT")
initFlagNames.set(CAP_INIT_EXT, "INIT_EXT")
initFlagNames.set(CAP_INIT_RESERVED, "INIT_RESERVED")
}

func (a *Attr) string() string {
Expand Down
3 changes: 0 additions & 3 deletions fuse/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,6 @@ const (
CAP_MAP_ALIGNMENT = (1 << 26)
CAP_SUBMOUNTS = (1 << 27)
CAP_HANDLE_KILLPRIV_V2 = (1 << 28)
CAP_SETXATTR_EXT = (1 << 29)
CAP_INIT_EXT = (1 << 30)
CAP_INIT_RESERVED = (1 << 31)

/* bits 32..63 get shifted down 32 bits into the Flags2 field */
CAP_SECURITY_CTX = (1 << 32)
Expand Down
10 changes: 10 additions & 0 deletions fuse/types_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ const (
EREMOTEIO = Status(syscall.EREMOTEIO)
)

// To be set in InitIn/InitOut.Flags.
//
// This flags conflict with https://github.com/osxfuse/fuse/blob/master/include/fuse_common.h
// and should be used only on Linux.
const (
CAP_SETXATTR_EXT = (1 << 29)
CAP_INIT_EXT = (1 << 30)
CAP_INIT_RESERVED = (1 << 31)
)

type Attr struct {
Ino uint64
Size uint64
Expand Down

0 comments on commit aab5a0d

Please sign in to comment.