]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: drop superfluous MMDSOpenInoReply
authorYan, Zheng <zyan@redhat.com>
Thu, 2 Feb 2017 10:56:12 +0000 (18:56 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 20 Feb 2017 08:12:36 +0000 (16:12 +0800)
Superfluous MMDSOpenInoReply can causes MDCache::handle_open_ino_reply()
to call MDCache::do_open_ino() in improper state.

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

index e5773dd30e822f2bcd4a67a2a1445cdf745dcb19..c6144e103a3cc31616a859688d83ea91bebd7249 100644 (file)
@@ -8680,11 +8680,10 @@ void MDCache::handle_open_ino_reply(MMDSOpenInoReply *m)
 
   inodeno_t ino = m->ino;
   mds_rank_t from = mds_rank_t(m->get_source().num());
-  if (opening_inodes.count(ino)) {
-    open_ino_info_t& info = opening_inodes[ino];
-
-    if (info.checking == from)
-       info.checking = MDS_RANK_NONE;
+  auto it = opening_inodes.find(ino);
+  if (it != opening_inodes.end() && it->second.checking == from) {
+    open_ino_info_t& info = it->second;
+    info.checking = MDS_RANK_NONE;
     info.checked.insert(from);
 
     CInode *in = get_inode(ino);