summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-22 17:19:31 -0700
committerSage Weil <sage@inktank.com>2013-07-22 17:19:31 -0700
commit093182b79680994a0ccb7942aff6722e62905181 (patch)
tree009b986836f33e17c4a37ddcfcdd8ef770a96ec2
parent6582b31abcb36a355b96d63c03ac17021c1e591f (diff)
downloadceph-093182b79680994a0ccb7942aff6722e62905181.tar.gz
osd/ReplicatedPG: drop repop refs in ~SnapTrimmer
This fixes a leak on shutdown. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc8
-rw-r--r--src/osd/ReplicatedPG.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index 9c8d42dbf3c..298d38d6ace 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -7767,6 +7767,14 @@ void ReplicatedPG::_scrub_finish()
#undef dout_prefix
#define dout_prefix *_dout << pg->gen_prefix()
+ReplicatedPG::SnapTrimmer::~SnapTrimmer()
+{
+ while (!repops.empty()) {
+ (*repops.begin())->put();
+ repops.erase(repops.begin());
+ }
+}
+
void ReplicatedPG::SnapTrimmer::log_enter(const char *state_name)
{
dout(20) << "enter " << state_name << dendl;
diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h
index 0d4867f6e6d..9dafe23faa1 100644
--- a/src/osd/ReplicatedPG.h
+++ b/src/osd/ReplicatedPG.h
@@ -982,6 +982,7 @@ private:
bool need_share_pg_info;
bool requeue;
SnapTrimmer(ReplicatedPG *pg) : pg(pg), need_share_pg_info(false), requeue(false) {}
+ ~SnapTrimmer();
void log_enter(const char *state_name);
void log_exit(const char *state_name, utime_t duration);
} snap_trimmer_machine;