浏览代码
[mount] fix metacache update (#4161)
pull/4163/head
wusong
3 年前
提交者
GitHub
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有
1 个文件被更改,包括
6 次插入 和
2 次删除
-
weed/mount/meta_cache/meta_cache.go
|
|
|
@ -70,8 +70,12 @@ func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath uti |
|
|
|
//mc.Lock()
|
|
|
|
//defer mc.Unlock()
|
|
|
|
|
|
|
|
oldDir, _ := oldPath.DirAndName() |
|
|
|
if mc.isCachedFn(util.FullPath(oldDir)) { |
|
|
|
entry, err := mc.FindEntry(ctx, oldPath) |
|
|
|
if err != nil && err != filer_pb.ErrNotFound { |
|
|
|
glog.Errorf("Metacache: find entry error: %v", err) |
|
|
|
return err |
|
|
|
} |
|
|
|
if entry != nil { |
|
|
|
if oldPath != "" { |
|
|
|
if newEntry != nil && oldPath == newEntry.FullPath { |
|
|
|
// skip the unnecessary deletion
|
|
|
|
|