From: Yan, Zheng Date: Wed, 26 Mar 2014 01:51:23 +0000 (+0800) Subject: mds: fix stack overflow caused by nested dispatch X-Git-Tag: v0.79~52^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ce936161694e09fec23a4a71ef5a9e5b065c837e;p=ceph.git 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 --- diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 6b53c14c6f68..2473ff0eb1fd 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!