1 Star 0 Fork 5

maqi/glusterfs

forked from src-anolis-os/glusterfs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0199-upcall-Avoid-sending-notifications-for-invalid-inode.patch 2.93 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-01-20 13:34 . import glusterfs-6.0-20.el8.src.rpm
From e41b4a45f9f5c07ffa38582d0bb4517f6a66eaa3 Mon Sep 17 00:00:00 2001
From: Soumya Koduri <skoduri@redhat.com>
Date: Fri, 7 Jun 2019 19:33:07 +0530
Subject: [PATCH 199/221] upcall: Avoid sending notifications for invalid
inodes
For nameless LOOKUPs, server creates a new inode which shall
remain invalid until the fop is successfully processed post
which it is linked to the inode table.
But incase if there is an already linked inode for that entry,
it discards that newly created inode which results in upcall
notification. This may result in client being bombarded with
unnecessary upcalls affecting performance if the data set is huge.
This issue can be avoided by looking up and storing the upcall
context in the original linked inode (if exists), thus saving up on
those extra callbacks.
This is backport of below upstream fix -
mainline: https://review.gluster.org/22840
release-6: https://review.gluster.org/22873
Change-Id: I044a1737819bb40d1a049d2f53c0566e746d2a17
fixes: bz#1717784
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/173507
Tested-by: RHGS Build Bot <nigelb@redhat.com>
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
---
xlators/features/upcall/src/upcall-internal.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/xlators/features/upcall/src/upcall-internal.c b/xlators/features/upcall/src/upcall-internal.c
index 46cf6f8..7998dd2 100644
--- a/xlators/features/upcall/src/upcall-internal.c
+++ b/xlators/features/upcall/src/upcall-internal.c
@@ -520,6 +520,7 @@ upcall_cache_invalidate(call_frame_t *frame, xlator_t *this, client_t *client,
upcall_client_t *tmp = NULL;
upcall_inode_ctx_t *up_inode_ctx = NULL;
gf_boolean_t found = _gf_false;
+ inode_t *linked_inode = NULL;
if (!is_upcall_enabled(this))
return;
@@ -532,7 +533,20 @@ upcall_cache_invalidate(call_frame_t *frame, xlator_t *this, client_t *client,
return;
}
- if (inode)
+ /* For nameless LOOKUPs, inode created shall always be
+ * invalid. Hence check if there is any already linked inode.
+ * If yes, update the inode_ctx of that valid inode
+ */
+ if (inode && (inode->ia_type == IA_INVAL) && stbuf) {
+ linked_inode = inode_find(inode->table, stbuf->ia_gfid);
+ if (linked_inode) {
+ gf_log("upcall", GF_LOG_DEBUG,
+ "upcall_inode_ctx_get of linked inode (%p)", inode);
+ up_inode_ctx = upcall_inode_ctx_get(linked_inode, this);
+ }
+ }
+
+ if (inode && !up_inode_ctx)
up_inode_ctx = upcall_inode_ctx_get(inode, this);
if (!up_inode_ctx) {
@@ -600,6 +614,9 @@ upcall_cache_invalidate(call_frame_t *frame, xlator_t *this, client_t *client,
}
pthread_mutex_unlock(&up_inode_ctx->client_list_lock);
out:
+ /* release the ref from inode_find */
+ if (linked_inode)
+ inode_unref(linked_inode);
return;
}
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/maqi77/glusterfs.git
git@gitee.com:maqi77/glusterfs.git
maqi77
glusterfs
glusterfs
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385