From: Venky Shankar Date: Mon, 13 Jan 2025 14:16:28 +0000 (+0530) Subject: Merge PR #57560 into wip-vshankar-testing-20250113.141608-reef-debug X-Git-Tag: testing/wip-vshankar-testing-20250113.141608-reef-debug~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5befa7fa2ed79037516ca8c26f2853588b950778;p=ceph-ci.git Merge PR #57560 into wip-vshankar-testing-20250113.141608-reef-debug * refs/pull/57560/head: mds: don't stall the asok thread for flush commands Reviewed-by: Xiubo Li --- 5befa7fa2ed79037516ca8c26f2853588b950778 diff --cc src/mds/MDSRank.cc index 7d089e89b9c,fa2a1bbb0c4..e29908e9a46 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@@ -2777,55 -2789,31 +2799,41 @@@ void MDSRankDispatcher::handle_asok_com goto out; } + auto respond = new AsyncResponse(f, std::move(on_finish)); finisher->queue( new LambdaContext( - [this, on_finish, f](int r) { - command_scrub_abort( - f, - new LambdaContext( - [on_finish, f](int r) { - bufferlist outbl; - f->open_object_section("result"); - f->dump_int("return_code", r); - f->close_section(); - on_finish(r, {}, outbl); - })); - })); + [this, respond](int r) { + std::lock_guard l(mds_lock); + scrubstack->scrub_abort(respond); + })); return; } else if (command == "scrub pause") { - if (whoami != 0) { + if (!is_active()) { + *css << "MDS is not active"; + r = -CEPHFS_EINVAL; + goto out; + } + else if (whoami != 0) { *css << "Not rank 0"; r = -CEPHFS_EXDEV; goto out; } + auto respond = new AsyncResponse(f, std::move(on_finish)); finisher->queue( new LambdaContext( - [this, on_finish, f](int r) { - command_scrub_pause( - f, - new LambdaContext( - [on_finish, f](int r) { - bufferlist outbl; - f->open_object_section("result"); - f->dump_int("return_code", r); - f->close_section(); - on_finish(r, {}, outbl); - })); - })); + [this, respond](int r) { + std::lock_guard l(mds_lock); + scrubstack->scrub_pause(respond); + })); return; } else if (command == "scrub resume") { - if (whoami != 0) { + if (!is_active()) { + *css << "MDS is not active"; + r = -CEPHFS_EINVAL; + goto out; + } + else if (whoami != 0) { *css << "Not rank 0"; r = -CEPHFS_EXDEV; goto out;