]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix race in "open inode by inode number" 16654/head
authorYan, Zheng <zyan@redhat.com>
Fri, 28 Jul 2017 08:27:26 +0000 (16:27 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 28 Jul 2017 09:05:19 +0000 (17:05 +0800)
If we have found inode in peer mds' cache, but failed to discover
the inode. The path to inode must have changed. we should check
peer again, instead of fetching backtrace, because inode's backtrace
may haven't been stored.

Fixes: http://tracker.ceph.com/issues/20806
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/MDCache.cc

index 1b27f8a15f654358d1d1705568e38ac974b7517c..c5289840ef694656af2518b481738e717798f717 100644 (file)
@@ -8616,7 +8616,13 @@ void MDCache::do_open_ino(inodeno_t ino, open_ino_info_t& info, int err)
       info.last_err = err;
   }
 
-  if (info.check_peers) {
+  if (info.check_peers || info.discover) {
+    if (info.discover) {
+      // got backtrace from peer, but failed to find inode. re-check peers
+      info.discover = false;
+      info.ancestors.clear();
+      info.checked.clear();
+    }
     info.check_peers = false;
     info.checking = MDS_RANK_NONE;
     do_open_ino_peer(ino, info);