mds: handle missing/corrupt data during boot

These errors trickle up to boot_start from e.g.
CInode::_fetched when something goes wrong.

Signed-off-by: John Spray <john.spray@redhat.com>
This commit is contained in:
John Spray 2015-04-30 17:44:23 +01:00
parent 816d9e0348
commit 6cb1f6cca7

View File

@ -1939,7 +1939,14 @@ void MDS::boot_start(BootStep step, int r)
dout(0) << "boot_start encountered an error EAGAIN"
<< ", respawning since we fell behind journal" << dendl;
respawn();
} else if (r == -EINVAL || r == -ENOENT) {
// Invalid or absent data, indicates damaged on-disk structures
clog->error() << "Error loading MDS rank " << whoami << ": "
<< cpp_strerror(r);
damaged();
assert(r == 0); // Unreachable, damaged() calls respawn()
} else {
// Completely unexpected error, give up and die
dout(0) << "boot_start encountered an error, failing" << dendl;
suicide();
return;