]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: properly put PIN_IMPORTBOUND when import aborts
authorYan, Zheng <zyan@redhat.com>
Thu, 16 Mar 2017 07:27:21 +0000 (15:27 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 30 Mar 2017 01:46:05 +0000 (09:46 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/Migrator.cc

index dedd3bea46b0ec234c17ad25aaaa143a095691c9..e55a3b266db0786c611b9b6a7ff18ea21ba40555 100644 (file)
@@ -2396,12 +2396,17 @@ void Migrator::import_remove_pins(CDir *dir, set<CDir*>& bounds)
     in->put_stickydirs();
   }
 
-  if (stat.state >= IMPORT_PREPPED) {
+  if (stat.state == IMPORT_PREPPING) {
+    for (auto bd : bounds) {
+      if (bd->state_test(CDir::STATE_IMPORTBOUND)) {
+       bd->put(CDir::PIN_IMPORTBOUND);
+       bd->state_clear(CDir::STATE_IMPORTBOUND);
+      }
+    }
+  } else if (stat.state >= IMPORT_PREPPED) {
     // bounding dirfrags
-    for (set<CDir*>::iterator it = bounds.begin();
-        it != bounds.end();
-        ++it) {
-      CDir *bd = *it;
+    for (auto bd : bounds) {
+      assert(bd->state_test(CDir::STATE_IMPORTBOUND));
       bd->put(CDir::PIN_IMPORTBOUND);
       bd->state_clear(CDir::STATE_IMPORTBOUND);
     }