summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-24 16:37:29 -0700
committerSage Weil <sage@inktank.com>2013-06-24 17:44:06 -0700
commit3791a1e55828ba541f9d3e8e3df0da8e79c375f9 (patch)
treec61f3b0f3e6e1a16eab3087562dae97ce2a0584e
parent9a9c941d8d9e311d1642f7a93813a4c43c5707ee (diff)
downloadceph-3791a1e55828ba541f9d3e8e3df0da8e79c375f9.tar.gz
osd: tolerate racing threads starting recovery ops
We sample the (max - active) recovery ops to know how many to start, but do not hold the lock over the full duration, such that it is possible to start too many ops. This isn't problematic except that our condition checks for being == max but not beyond it, and we will continue to start recovery ops when we shouldn't. Fix this by adjusting the conditional to be <=. Reported-by: Stefan Priebe <s.priebe@profihost.ag> Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: David Zafman <david.zafman@inktank.com>
-rw-r--r--src/osd/OSD.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index e96e05eb7cd..57d6d7245c6 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -6493,7 +6493,7 @@ void OSD::do_recovery(PG *pg)
recovery_wq.lock();
int max = g_conf->osd_recovery_max_active - recovery_ops_active;
recovery_wq.unlock();
- if (max == 0) {
+ if (max <= 0) {
dout(10) << "do_recovery raced and failed to start anything; requeuing " << *pg << dendl;
recovery_wq.queue(pg);
} else {