From ad9c12e1b9314de8f533ceb7d256b028f9c066d7 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 16 Jun 2024 23:42:59 +0300 Subject: [PATCH] Fix Pseudo-FS initialization leading to ENOENTs some time after start --- src/nfs/nfs_proxy.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/nfs/nfs_proxy.cpp b/src/nfs/nfs_proxy.cpp index 9bcf9d40..65496d45 100644 --- a/src/nfs/nfs_proxy.cpp +++ b/src/nfs/nfs_proxy.cpp @@ -189,6 +189,12 @@ void nfs_proxy_t::run(json11::Json cfg) cmd->epmgr = epmgr; cmd->cli = cli; watch_stats(); + // Init Pseudo-FS before starting client because it depends on inode_change_hook + if (fsname == "") + { + blockfs = new block_fs_state_t(); + blockfs->init(this, cfg); + } // Load image metadata while (!cli->is_ready()) { @@ -199,13 +205,8 @@ void nfs_proxy_t::run(json11::Json cfg) } // Check default pool check_default_pool(); - // Check if we're using VitastorFS - if (fsname == "") - { - blockfs = new block_fs_state_t(); - blockfs->init(this, cfg); - } - else + // Init VitastorFS after starting client because it depends on loaded inode configuration + if (fsname != "") { kvfs = new kv_fs_state_t(); kvfs->init(this, cfg);