]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/CephFSPlugin.pm
Don't remove and recreate lun when changing a volume
[pve-storage.git] / PVE / Storage / CephFSPlugin.pm
index 16fc3160dfce9319cddb16829ac65ad46d2d5887..c18f8c937029d46b68aeafded5ec8d0a9d9c30ad 100644 (file)
@@ -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;
 
@@ -65,11 +63,12 @@ sub cephfs_mount {
        my $source = "$server:$subdir";
        $cmd = ['/bin/mount', '-t', 'ceph', $source, $mountpoint, '-o', "name=$cmd_option->{userid}"];
        push @$cmd, '-o', "secretfile=$secretfile" if defined($secretfile);
+
+       # tell systemd that we're network dependent, else it umounts us to late
+       # on shutdown, when we couldn't connect to the active MDS and thus
+       # unmount hangs and delays shutdown/reboot (man systemd.mount).
+       push @$cmd, '-o', '_netdev';
     }
-    # tell systemd that we're network dependent, else it umounts us to late on
-    # shutdown, when we couldn't connect to the active MDS and thus unmount
-    # hangs and delays shutdown/reboot (man systemd.mount)
-    push @$cmd, '-o', '_netdev';
 
     if ($scfg->{options}) {
        push @$cmd, '-o', $scfg->{options};