From: Yan, Zheng Date: Mon, 26 Mar 2018 07:55:02 +0000 (+0800) Subject: mds: mark damaged if sessions' preallocated inos don't match inotable X-Git-Tag: v12.2.6~151^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0f9703ee4682985aaa6e5536b972073a2a5e0834;p=ceph.git mds: mark damaged if sessions' preallocated inos don't match inotable We don't know if session's preallocated inos are incorrect or inotable is incorrect. So it's better just mark mds damaged. Fixes: http://tracker.ceph.com/issues/23452 Signed-off-by: "Yan, Zheng" (cherry picked from commit e5832658d8654bdf11fcb3357b84e3853fd86031) --- diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index de0a7c3e60a..5791b845efe 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -1140,7 +1140,7 @@ void MDSRank::boot_start(BootStep step, int r) void MDSRank::validate_sessions() { assert(mds_lock.is_locked_by_me()); - std::vector victims; + bool valid = true; // Identify any sessions which have state inconsistent with other, // after they have been loaded from rados during startup. @@ -1150,19 +1150,15 @@ void MDSRank::validate_sessions() Session *session = i.second; interval_set badones; if (inotable->intersects_free(session->info.prealloc_inos, &badones)) { - clog->error() << "Client session loaded with invalid preallocated " - "inodes, evicting session " << *session; - - // Make the session consistent with inotable so that it can - // be cleanly torn down - session->info.prealloc_inos.subtract(badones); - - victims.push_back(session); + clog->error() << "client " << *session + << "loaded with preallocated inodes that are inconsistent with inotable"; + valid = false; } } - for (const auto &session: victims) { - server->kill_session(session, nullptr); + if (!valid) { + damaged(); + assert(valid); } }