From 82881c5f9e3c50549c159847a391afe23cb1855b Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 3 Jul 2019 09:42:13 +0200 Subject: [PATCH] cephfs: make is_mounted check less strict checking '$server:$subdir' is too strict to work in all cirumcstances, e.g. adding/removing a monitor would mean that it is not the same anymore, same if one is adding/removing the ports from the config check only if the subdir is the same and if it is a cephfs this way, it still returns true if someone changes the config Signed-off-by: Dominik Csapak --- PVE/Storage/CephFSPlugin.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PVE/Storage/CephFSPlugin.pm b/PVE/Storage/CephFSPlugin.pm index 53491ed..c18f8c9 100644 --- a/PVE/Storage/CephFSPlugin.pm +++ b/PVE/Storage/CephFSPlugin.pm @@ -20,16 +20,14 @@ sub cephfs_is_mounted { my $cmd_option = PVE::CephConfig::ceph_connect_option($scfg, $storeid); my $configfile = $cmd_option->{ceph_conf}; - my $server = $cmd_option->{mon_host} // PVE::CephConfig::get_monaddr_list($configfile); my $subdir = $scfg->{subdir} // '/'; my $mountpoint = $scfg->{path}; - my $source = "$server:$subdir"; $mountdata = PVE::ProcFSTools::parse_proc_mounts() if !$mountdata; return $mountpoint if grep { $_->[2] =~ m#^ceph|fuse\.ceph-fuse# && - $_->[0] =~ m#^\Q$source\E|ceph-fuse$# && + $_->[0] =~ m#\Q:$subdir\E$|^ceph-fuse$# && $_->[1] eq $mountpoint } @$mountdata;