mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(client): Disable xattr security.capability to avoid useless request to backend
close:#1000519910 @formatter:off Signed-off-by: leonrayang <changliang@oppo.com>
This commit is contained in:
parent
2b6173f7e6
commit
0b02c44208
@ -970,6 +970,16 @@ func (d *Dir) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp *fus
|
||||
d.super.runningMonitor.SubClientOp(runningStat, err)
|
||||
}()
|
||||
|
||||
// Optimize: directly return empty value for security.capability to avoid frequent server queries
|
||||
// This avoids backend service access for system xattr that is frequently queried during write operations
|
||||
if name == "security.capability" {
|
||||
resp.Xattr = []byte{}
|
||||
if log.EnableDebug() {
|
||||
log.LogDebugf("TRACE GetXattr: ino(%v) name(%v) (optimized, returning empty)", ino, name)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if name == meta.SummaryKey {
|
||||
var summaryInfo meta.SummaryInfo
|
||||
summaryInfo, err = d.super.mw.GetSummary_ll(ino, 20)
|
||||
|
||||
@ -815,6 +815,15 @@ func (f *File) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp *fu
|
||||
name := req.Name
|
||||
size := req.Size
|
||||
pos := req.Position
|
||||
|
||||
// Optimize: directly return empty value for security.capability to avoid frequent server queries
|
||||
// This avoids backend service access for system xattr that is frequently queried during write operations
|
||||
if name == "security.capability" {
|
||||
resp.Xattr = []byte{}
|
||||
log.LogDebugf("TRACE GetXattr: ino(%v) name(%v) (optimized, returning empty)", ino, name)
|
||||
return nil
|
||||
}
|
||||
|
||||
info, err := f.super.mw.XAttrGet_ll(ino, name)
|
||||
if err != nil {
|
||||
log.LogErrorf("GetXattr: ino(%v) name(%v) err(%v)", ino, name, err)
|
||||
|
||||
@ -5,17 +5,20 @@ package proto
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
var (
|
||||
_ = proto.Marshal
|
||||
_ = fmt.Errorf
|
||||
_ = math.Inf
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
@ -40,9 +43,11 @@ func (*DataSource) ProtoMessage() {}
|
||||
func (*DataSource) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{0}
|
||||
}
|
||||
|
||||
func (m *DataSource) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *DataSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_DataSource.Marshal(b, m, deterministic)
|
||||
@ -55,12 +60,15 @@ func (m *DataSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *DataSource) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_DataSource.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *DataSource) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *DataSource) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_DataSource.DiscardUnknown(m)
|
||||
}
|
||||
@ -127,9 +135,11 @@ func (*CacheRequest) ProtoMessage() {}
|
||||
func (*CacheRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{1}
|
||||
}
|
||||
|
||||
func (m *CacheRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *CacheRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_CacheRequest.Marshal(b, m, deterministic)
|
||||
@ -142,12 +152,15 @@ func (m *CacheRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *CacheRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CacheRequest.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *CacheRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *CacheRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CacheRequest.DiscardUnknown(m)
|
||||
}
|
||||
@ -217,9 +230,11 @@ func (*CacheReadRequest) ProtoMessage() {}
|
||||
func (*CacheReadRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{2}
|
||||
}
|
||||
|
||||
func (m *CacheReadRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *CacheReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_CacheReadRequest.Marshal(b, m, deterministic)
|
||||
@ -232,12 +247,15 @@ func (m *CacheReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *CacheReadRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CacheReadRequest.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *CacheReadRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *CacheReadRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CacheReadRequest.DiscardUnknown(m)
|
||||
}
|
||||
@ -278,9 +296,11 @@ func (*CachePrepareRequest) ProtoMessage() {}
|
||||
func (*CachePrepareRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{3}
|
||||
}
|
||||
|
||||
func (m *CachePrepareRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *CachePrepareRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_CachePrepareRequest.Marshal(b, m, deterministic)
|
||||
@ -293,12 +313,15 @@ func (m *CachePrepareRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte,
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *CachePrepareRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CachePrepareRequest.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *CachePrepareRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *CachePrepareRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CachePrepareRequest.DiscardUnknown(m)
|
||||
}
|
||||
@ -333,9 +356,11 @@ func (*PutBlockHead) ProtoMessage() {}
|
||||
func (*PutBlockHead) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{4}
|
||||
}
|
||||
|
||||
func (m *PutBlockHead) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *PutBlockHead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_PutBlockHead.Marshal(b, m, deterministic)
|
||||
@ -348,12 +373,15 @@ func (m *PutBlockHead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *PutBlockHead) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PutBlockHead.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *PutBlockHead) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *PutBlockHead) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PutBlockHead.DiscardUnknown(m)
|
||||
}
|
||||
@ -398,9 +426,11 @@ func (*CacheReadRequestBase) ProtoMessage() {}
|
||||
func (*CacheReadRequestBase) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{5}
|
||||
}
|
||||
|
||||
func (m *CacheReadRequestBase) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *CacheReadRequestBase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_CacheReadRequestBase.Marshal(b, m, deterministic)
|
||||
@ -413,12 +443,15 @@ func (m *CacheReadRequestBase) XXX_Marshal(b []byte, deterministic bool) ([]byte
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *CacheReadRequestBase) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CacheReadRequestBase.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *CacheReadRequestBase) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *CacheReadRequestBase) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CacheReadRequestBase.DiscardUnknown(m)
|
||||
}
|
||||
@ -484,9 +517,11 @@ func (*BatchReadItem) ProtoMessage() {}
|
||||
func (*BatchReadItem) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{6}
|
||||
}
|
||||
|
||||
func (m *BatchReadItem) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *BatchReadItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_BatchReadItem.Marshal(b, m, deterministic)
|
||||
@ -499,12 +534,15 @@ func (m *BatchReadItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *BatchReadItem) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BatchReadItem.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *BatchReadItem) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *BatchReadItem) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BatchReadItem.DiscardUnknown(m)
|
||||
}
|
||||
@ -566,9 +604,11 @@ func (*BatchReadReq) ProtoMessage() {}
|
||||
func (*BatchReadReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{7}
|
||||
}
|
||||
|
||||
func (m *BatchReadReq) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *BatchReadReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_BatchReadReq.Marshal(b, m, deterministic)
|
||||
@ -581,12 +621,15 @@ func (m *BatchReadReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *BatchReadReq) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BatchReadReq.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *BatchReadReq) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *BatchReadReq) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BatchReadReq.DiscardUnknown(m)
|
||||
}
|
||||
@ -622,9 +665,11 @@ func (*ReadResult) ProtoMessage() {}
|
||||
func (*ReadResult) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{8}
|
||||
}
|
||||
|
||||
func (m *ReadResult) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *ReadResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_ReadResult.Marshal(b, m, deterministic)
|
||||
@ -637,12 +682,15 @@ func (m *ReadResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *ReadResult) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ReadResult.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *ReadResult) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *ReadResult) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ReadResult.DiscardUnknown(m)
|
||||
}
|
||||
@ -689,9 +737,11 @@ func (*BatchReadResp) ProtoMessage() {}
|
||||
func (*BatchReadResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9a29821e5022ef34, []int{9}
|
||||
}
|
||||
|
||||
func (m *BatchReadResp) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
|
||||
func (m *BatchReadResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_BatchReadResp.Marshal(b, m, deterministic)
|
||||
@ -704,12 +754,15 @@ func (m *BatchReadResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
|
||||
func (m *BatchReadResp) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BatchReadResp.Merge(m, src)
|
||||
}
|
||||
|
||||
func (m *BatchReadResp) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
|
||||
func (m *BatchReadResp) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BatchReadResp.DiscardUnknown(m)
|
||||
}
|
||||
@ -1325,6 +1378,7 @@ func encodeVarintDistributedCache(dAtA []byte, offset int, v uint64) int {
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
|
||||
func (m *DataSource) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
@ -1591,9 +1645,11 @@ func (m *BatchReadResp) Size() (n int) {
|
||||
func sovDistributedCache(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
|
||||
func sozDistributedCache(x uint64) (n int) {
|
||||
return sovDistributedCache(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
|
||||
func (m *DataSource) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -1772,6 +1828,7 @@ func (m *DataSource) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CacheRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -1984,6 +2041,7 @@ func (m *CacheRequest) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CacheReadRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -2109,6 +2167,7 @@ func (m *CacheReadRequest) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CachePrepareRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -2228,6 +2287,7 @@ func (m *CachePrepareRequest) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PutBlockHead) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -2349,6 +2409,7 @@ func (m *PutBlockHead) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CacheReadRequestBase) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -2527,6 +2588,7 @@ func (m *CacheReadRequestBase) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BatchReadItem) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -2718,6 +2780,7 @@ func (m *BatchReadItem) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BatchReadReq) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -2822,6 +2885,7 @@ func (m *BatchReadReq) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ReadResult) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -2964,6 +3028,7 @@ func (m *ReadResult) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BatchReadResp) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@ -3049,6 +3114,7 @@ func (m *BatchReadResp) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func skipDistributedCache(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user