summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-24 16:37:29 -0700
committerSamuel Just <sam.just@inktank.com>2013-08-13 13:31:38 -0700
commit4433f9ad8b338b6a55e205602434b307287bfaa3 (patch)
tree2e83e8e9e4f8ac418d9192d30d4445a92e0a76ff
parent0964d53ef3e8e386e0a1635d2240aefad7b8e2c1 (diff)
downloadceph-4433f9ad8b338b6a55e205602434b307287bfaa3.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> (cherry picked from commit 3791a1e55828ba541f9d3e8e3df0da8e79c375f9)
-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 679f0e143bd..7d0a0e3e5e6 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -6057,7 +6057,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 {