代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/nfs-utils 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From e115a6edfaa07203c6d6d40eba9e4f097efe0cf2 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Wed, 25 Oct 2023 12:40:24 -0400
Subject: [PATCH] export: move cache_open() before workers are forked.
If each worker has a separate open on a cache channel, then each worker
will potentially receive every upcall request resulting in duplicated
work.
A worker will only not see a request that another worker sees if that
other worker answers the request before this worker gets a chance to
read it.
To avoid duplicate effort between threads and so get maximum benefit
from multiple threads, open the cache channels before forking.
Note that the kernel provides locking so that only one thread can be
reading to writing to any channel at any given moment.
Fixes: 5fc3bac9e0c3 ("mountd: Ensure we don't share cache file descriptors among processes.")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/exportd/exportd.c | 8 ++++++--
utils/mountd/mountd.c | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/utils/exportd/exportd.c b/utils/exportd/exportd.c
index 2dd12cb..6f86644 100644
--- a/utils/exportd/exportd.c
+++ b/utils/exportd/exportd.c
@@ -289,12 +289,16 @@ main(int argc, char **argv)
else if (num_threads > MAX_THREADS)
num_threads = MAX_THREADS;
+ /* Open cache channel files BEFORE forking so each upcall is
+ * only handled by one thread. Kernel provides locking for both
+ * read and write.
+ */
+ cache_open();
+
if (num_threads > 1)
fork_workers();
- /* Open files now to avoid sharing descriptors among forked processes */
- cache_open();
v4clients_init();
/* Process incoming upcalls */
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
index bcf749f..f9c62cd 100644
--- a/utils/mountd/mountd.c
+++ b/utils/mountd/mountd.c
@@ -916,12 +916,16 @@ main(int argc, char **argv)
else if (num_threads > MAX_THREADS)
num_threads = MAX_THREADS;
+ /* Open cache channel files BEFORE forking so each upcall is
+ * only handled by one thread. Kernel provides locking for both
+ * read and write.
+ */
+ cache_open();
+
if (num_threads > 1)
fork_workers();
nfsd_path_init();
- /* Open files now to avoid sharing descriptors among forked processes */
- cache_open();
v4clients_init();
xlog(L_NOTICE, "Version " VERSION " starting");
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。