Skip to content

Commit

Permalink
osd/ReplicatedPG: drop repop refs in ~SnapTrimmer
Browse files Browse the repository at this point in the history
This fixes a leak on shutdown.

Signed-off-by: Sage Weil <[email protected]>
Reviewed-by: Samuel Just <[email protected]>
  • Loading branch information
Sage Weil committed Jul 23, 2013
1 parent 6582b31 commit 093182b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/osd/ReplicatedPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/osd/ReplicatedPG.h
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ class ReplicatedPG : public PG {
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;
Expand Down

0 comments on commit 093182b

Please sign in to comment.