]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: mark damaged if sessions' preallocated inos don't match inotable 21372/head
authorYan, Zheng <zyan@redhat.com>
Mon, 26 Mar 2018 07:55:02 +0000 (15:55 +0800)
committerPrashant D <pdhange@redhat.com>
Thu, 12 Apr 2018 09:28:22 +0000 (05:28 -0400)
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>
(cherry picked from commit e5832658d8654bdf11fcb3357b84e3853fd86031)

src/mds/MDSRank.cc

index de0a7c3e60af05b90987d7c67cd5ebfce0e46dcb..5791b845efecf272d26649ba343948877ac2c73d 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);
   }
 }