]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: mark damaged if sessions' preallocated inos don't match inotable
authorYan, Zheng <zyan@redhat.com>
Mon, 26 Mar 2018 07:55:02 +0000 (15:55 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 4 Apr 2018 02:17:15 +0000 (10:17 +0800)
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" <zyan@redhat.com>
src/mds/MDSRank.cc

index d36d680d5708ed74b92435e9972d88d02f790799..3cc7a0100071249642ee9caf76dad1952e9e2a1c 100644 (file)
@@ -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<Session*> 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<inodeno_t> 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);
   }
 }