From ce936161694e09fec23a4a71ef5a9e5b065c837e Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 26 Mar 2014 09:51:23 +0800 Subject: [PATCH] mds: fix stack overflow caused by nested dispatch Commit bc3325b37 fixes a stack overflow bug happens when replaying client requests. Similar stack overflow can happens when processing finished contexts. Signed-off-by: Yan, Zheng --- src/mds/MDS.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 6b53c14c6f680..2473ff0eb1fda 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -1923,6 +1923,9 @@ bool MDS::_dispatch(Message *m) } } + if (dispatch_depth > 1) + return true; + // finish any triggered contexts while (!finished_queue.empty()) { dout(7) << "mds has " << finished_queue.size() << " queued contexts" << dendl; @@ -1940,9 +1943,6 @@ bool MDS::_dispatch(Message *m) } } - if (dispatch_depth > 1) - return true; - while (!waiting_for_nolaggy.empty()) { // stop if we're laggy now! -- 2.39.5