mirror of
https://github.com/ceph/ceph
synced 2025-02-25 03:52:04 +00:00
journaler: check return code on _finish_write_head.
If we get an error code and assume we successfully wrote the head, there are going to be all kinds of issues on replay! Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
This commit is contained in:
parent
42a7013907
commit
e6393525cf
@ -309,7 +309,7 @@ public:
|
||||
Context *oncommit;
|
||||
C_WriteHead(Journaler *l, Header& h_, Context *c) : ls(l), h(h_), oncommit(c) {}
|
||||
void finish(int r) {
|
||||
ls->_finish_write_head(h, oncommit);
|
||||
ls->_finish_write_head(r, h, oncommit);
|
||||
}
|
||||
};
|
||||
|
||||
@ -336,8 +336,9 @@ void Journaler::write_head(Context *oncommit)
|
||||
new C_WriteHead(this, last_written, oncommit));
|
||||
}
|
||||
|
||||
void Journaler::_finish_write_head(Header &wrote, Context *oncommit)
|
||||
void Journaler::_finish_write_head(int r, Header &wrote, Context *oncommit)
|
||||
{
|
||||
assert(r >= 0); // we can't really recover from write errors here
|
||||
assert(!readonly);
|
||||
dout(10) << "_finish_write_head " << wrote << dendl;
|
||||
last_committed = wrote;
|
||||
|
@ -138,7 +138,7 @@ private:
|
||||
|
||||
// header
|
||||
utime_t last_wrote_head;
|
||||
void _finish_write_head(Header &wrote, Context *oncommit);
|
||||
void _finish_write_head(int r, Header &wrote, Context *oncommit);
|
||||
class C_WriteHead;
|
||||
friend class C_WriteHead;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user