]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't try opening inodes that haven't been created
authorYan, Zheng <zyan@redhat.com>
Fri, 19 Jan 2018 23:07:57 +0000 (07:07 +0800)
committerYan, Zheng <zyan@redhat.com>
Sun, 11 Feb 2018 10:15:22 +0000 (18:15 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/MDCache.h
src/mds/Server.cc

index ed138f3078a47d1641134b286ae7577112104e81..f271592384c4e505cff171882a08c8b1534d8bae 100644 (file)
@@ -600,6 +600,9 @@ public:
   bool rejoin_has_cap_reconnect(inodeno_t ino) const {
     return cap_imports.count(ino);
   }
+  void add_replay_ino_alloc(inodeno_t ino) {
+    cap_imports_missing.insert(ino); // avoid opening ino during cache rejoin
+  }
   const cap_reconnect_t *get_replay_cap_reconnect(inodeno_t ino, client_t client) {
     if (cap_imports.count(ino) &&
        cap_imports[ino].count(client) &&
index b78c04ec71c93cdc4aa12125edb1d9594a91d5b0..8f365378ac30711a42cd5f7fb0361b2cdf640936 100644 (file)
@@ -214,6 +214,10 @@ void Server::dispatch(Message *m)
       if (req->is_replay()) {
        dout(3) << "queuing replayed op" << dendl;
        queue_replay = true;
+       if (req->head.ino &&
+           !session->have_completed_request(req->get_reqid().tid, nullptr)) {
+         mdcache->add_replay_ino_alloc(inodeno_t(req->head.ino));
+       }
       } else if (req->get_retry_attempt()) {
        // process completed request in clientreplay stage. The completed request
        // might have created new file/directorie. This guarantees MDS sends a reply