diff --git a/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp b/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp index ed8ecb8da4982e4115fc699a80eaceebe8a1830b..e22bfb83c2e986363d4014914c5fbff452c62c90 100644 --- a/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp +++ b/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp @@ -445,8 +445,6 @@ static int CloudDoLookupHelper(fuse_ino_t parent, const char *name, struct fuse_ child->refCount++; if (create) { child->mBase = make_shared(mBase); - child->path = childName; - child->parent = parent; #ifdef HICOLLIE_ENABLE XcollieInput xcollieInput{child.get(), FaultOperation::LOOKUP}; auto xcollieId = XCollieHelper::SetTimer("CloudFileDaemon_CloudLookup", LOOKUP_TIMEOUT_S, @@ -462,6 +460,12 @@ static int CloudDoLookupHelper(fuse_ino_t parent, const char *name, struct fuse_ LOGW("invalidate %s", childName.c_str()); child->mBase = make_shared(mBase); } + if (child->path != childName) { + CLOUD_FILE_FAULT_REPORT(CloudFileFaultInfo{PHOTOS_BUNDLE_NAME, FaultOperation::LOOKUP, + FaultType::INODE_FILE, ENOMEM, "hash collision"}); + } + child->path = childName; + child->parent = parent; LOGD("lookup success, child: %{private}s, refCount: %lld", GetAnonyString(child->path).c_str(), static_cast(child->refCount)); GetMetaAttr(data, child, &e->attr);