From f824d0e0b4d04db28b994b138e30f469318ea1af Mon Sep 17 00:00:00 2001 From: waterwin Date: Wed, 17 Aug 2022 10:57:19 +0800 Subject: [PATCH] hmdfs: it is too long to lookup in merge view ohos inclusion category: bugfix issue: #I5MZYN CVE: NA ---------------------------------------------- the time to lookup in merge view is too long Signed-off-by: waterwin --- fs/hmdfs/inode_merge.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/fs/hmdfs/inode_merge.c b/fs/hmdfs/inode_merge.c index 8315eba05cfc..134c9d8d7f76 100644 --- a/fs/hmdfs/inode_merge.c +++ b/fs/hmdfs/inode_merge.c @@ -425,12 +425,10 @@ static int lookup_merge_normal(struct dentry *child_dentry, unsigned int flags) static int do_lookup_merge_root(struct path path_dev, struct dentry *child_dentry, unsigned int flags) { - struct hmdfs_sb_info *sbi = hmdfs_sb(child_dentry->d_sb); struct hmdfs_dentry_comrade *comrade; const int buf_len = max((int)HMDFS_CID_SIZE + 1, (int)sizeof(DEVICE_VIEW_LOCAL)); char *buf = kzalloc(buf_len, GFP_KERNEL); - struct hmdfs_peer *peer; LIST_HEAD(head); int ret; @@ -446,20 +444,6 @@ static int do_lookup_merge_root(struct path path_dev, } link_comrade(&head, comrade); - // lookup real_dst/device_view/cidxx - mutex_lock(&sbi->connections.node_lock); - list_for_each_entry(peer, &sbi->connections.node_list, list) { - mutex_unlock(&sbi->connections.node_lock); - memcpy(buf, peer->cid, HMDFS_CID_SIZE); - comrade = lookup_comrade(path_dev, buf, peer->device_id, flags); - if (IS_ERR(comrade)) - continue; - - link_comrade(&head, comrade); - mutex_lock(&sbi->connections.node_lock); - } - mutex_unlock(&sbi->connections.node_lock); - assign_comrades_unlocked(child_dentry, &head); ret = 0; -- Gitee