]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix FSMap copy constructor
authorJohn Spray <john.spray@redhat.com>
Fri, 29 Sep 2017 10:43:24 +0000 (06:43 -0400)
committerJohn Spray <john.spray@redhat.com>
Fri, 29 Sep 2017 11:05:13 +0000 (07:05 -0400)
This was confusing ceph-mgr, which did a fsmap = new_fsmap
and found that old filesystems were never disappearing
after being removed.

Fixes: http://tracker.ceph.com/issues/21599
Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/FSMap.h

index ea102a712740c63045bd1573d59b7a2c6484b0d4..a34d278cd31612b1d156e97746a2a1055c723f51 100644 (file)
@@ -132,6 +132,7 @@ public:
       standby_daemons(rhs.standby_daemons),
       standby_epochs(rhs.standby_epochs)
   {
+    filesystems.clear();
     for (const auto &i : rhs.filesystems) {
       const auto &fs = i.second;
       filesystems[fs->fscid] = std::make_shared<Filesystem>(*fs);
@@ -149,6 +150,7 @@ public:
     standby_daemons = rhs.standby_daemons;
     standby_epochs = rhs.standby_epochs;
 
+    filesystems.clear();
     for (const auto &i : rhs.filesystems) {
       const auto &fs = i.second;
       filesystems[fs->fscid] = std::make_shared<Filesystem>(*fs);