ReplicatedPG::snap_trimmer: requeue if scrub_block_writes

Otherwise, we do not continue snap_trimming once scrub is
complete.

Noticed while revewing another patch.  This would result
in snaps not being trimmed again until the next map
update.

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2012-07-30 13:36:39 -07:00
parent 480380025b
commit 1041b92ca5

View File

@ -1439,16 +1439,15 @@ void ReplicatedPG::snap_trimmer()
dout(10) << "snap_trimmer entry" << dendl;
if (is_primary()) {
entity_inst_t nobody;
if (!mode.try_write(nobody)) {
if (!mode.try_write(nobody) || scrub_block_writes) {
dout(10) << " can't write, requeueing" << dendl;
queue_snap_trim();
unlock();
return;
}
if (!scrub_block_writes) {
dout(10) << "snap_trimmer posting" << dendl;
snap_trimmer_machine.process_event(SnapTrim());
}
dout(10) << "snap_trimmer posting" << dendl;
snap_trimmer_machine.process_event(SnapTrim());
if (snap_trimmer_machine.need_share_pg_info) {
dout(10) << "snap_trimmer share_pg_info" << dendl;