]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client/fuse: set max_idle_threads to the correct value
authorZhansong Gao <zhsgao@hotmail.com>
Mon, 28 Nov 2022 09:20:15 +0000 (17:20 +0800)
committerZhansong Gao <zhsgao@hotmail.com>
Tue, 29 Nov 2022 11:15:33 +0000 (19:15 +0800)
When the version of the libfuse is 3.1 or later,
the fuse worker thread of ceph-fuse keeps recreating
and deleting file or directory will be blocked forever.
It is caused by parameter 'max_idle_threads' being set to 0
and the relevant logic is in function 'fuse_do_work' of libfuse.
Parameter 'max_idle_threads' can be set by function 'fuse_parse_cmdline',
it may be the default value(10 before version 3.12 and -1 after)
or a value set by user. It should not be set to 0.

Fixes: https://tracker.ceph.com/issues/58109
Signed-off-by: Zhansong Gao <zhsgao@hotmail.com>
src/client/fuse_ll.cc

index 2f4cd28b340791c0e0715680139b8fba2b799a1a..517eb79ce8c2d9ff5ae95b516332e6c205e839b0 100644 (file)
@@ -1605,9 +1605,10 @@ int CephFuse::Handle::loop()
   if (fuse_multithreaded) {
 #if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 1)
     {
-      struct fuse_loop_config conf = { 0 };
-
-      conf.clone_fd = opts.clone_fd;
+      struct fuse_loop_config conf = {
+        clone_fd: opts.clone_fd,
+        max_idle_threads: opts.max_idle_threads
+      };
       return fuse_session_loop_mt(se, &conf);
     }
 #elif FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)