Skip to content

Commit

Permalink
os/FileJournal: signal aio_cond even if seq is 0
Browse files Browse the repository at this point in the history
This can happen if we write a journal but no events.

Reported-by: Somnath Roy <somnath.roy@sandisk.com>
Reported-by: Ma, Jianpeng <jianpeng.ma@intel.com>
Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Aug 20, 2014
1 parent 5bf472a commit 57778e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/os/FileJournal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ void FileJournal::check_aio_completion()
assert(aio_lock.is_locked());
dout(20) << "check_aio_completion" << dendl;

bool completed_something = false;
bool completed_something = false, signal = false;
uint64_t new_journaled_seq = 0;

list<aio_info>::iterator p = aio_queue.begin();
Expand All @@ -1391,6 +1391,7 @@ void FileJournal::check_aio_completion()
aio_num--;
aio_bytes -= p->len;
aio_queue.erase(p++);
signal = true;
}

if (completed_something) {
Expand All @@ -1410,7 +1411,8 @@ void FileJournal::check_aio_completion()
queue_completions_thru(journaled_seq);
}
}

}
if (signal) {
// maybe write queue was waiting for aio count to drop?
aio_cond.Signal();
}
Expand Down

0 comments on commit 57778e2

Please sign in to comment.