Skip to content

Commit

Permalink
Fix: metadata modification
Browse files Browse the repository at this point in the history
Using CopyGet instead Get while modify extend or multipart session data.

Signed-off-by: Mofei Zhang <[email protected]>
  • Loading branch information
mervinkid committed Jun 19, 2020
1 parent b0b3e8f commit 3794ca2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions metanode/partition_fsmop_extend.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type ExtendOpResult struct {
}

func (mp *metaPartition) fsmSetXAttr(extend *Extend) (err error) {
treeItem := mp.extendTree.Get(extend)
treeItem := mp.extendTree.CopyGet(extend)
var e *Extend
if treeItem == nil {
e = NewExtend(extend.inode)
Expand All @@ -33,7 +33,7 @@ func (mp *metaPartition) fsmSetXAttr(extend *Extend) (err error) {
}

func (mp *metaPartition) fsmRemoveXAttr(extend *Extend) (err error) {
treeItem := mp.extendTree.Get(extend)
treeItem := mp.extendTree.CopyGet(extend)
if treeItem == nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion metanode/partition_fsmop_multipart.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (mp *metaPartition) fsmRemoveMultipart(multipart *Multipart) (status uint8)
}

func (mp *metaPartition) fsmAppendMultipart(multipart *Multipart) (status uint8) {
storedItem := mp.multipartTree.Get(multipart)
storedItem := mp.multipartTree.CopyGet(multipart)
if storedItem == nil {
return proto.OpNotExistErr
}
Expand Down

0 comments on commit 3794ca2

Please sign in to comment.