From: Yan, Zheng Date: Thu, 16 Mar 2017 07:27:21 +0000 (+0800) Subject: mds: properly put PIN_IMPORTBOUND when import aborts X-Git-Tag: v12.0.2~112^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9305f66a29a8f977d3219f7e6fa0c882e2ff8033;p=ceph.git mds: properly put PIN_IMPORTBOUND when import aborts Signed-off-by: "Yan, Zheng" --- diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index dedd3bea46b0..e55a3b266db0 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -2396,12 +2396,17 @@ void Migrator::import_remove_pins(CDir *dir, set& 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::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); }