]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: re-send discover if want_xlocked becomes true
authorYan, Zheng <zheng.z.yan@intel.com>
Fri, 8 Nov 2013 09:45:12 +0000 (17:45 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Mon, 16 Dec 2013 04:15:23 +0000 (12:15 +0800)
If want_xlocked becomes true, we can not rely on previously sent discover
because it's likely the previous discover is blocked on the xlocked dentry.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/MDCache.cc

index 18f57910fc5bc769853d76a73944b689e20b7ef5..7c4c982ab7bda55b10f32b4504e6810d773e12fb 100644 (file)
@@ -8350,8 +8350,18 @@ void MDCache::open_ino(inodeno_t ino, int64_t pool, Context* fin,
     open_ino_info_t& info = opening_inodes[ino];
     if (want_replica) {
       info.want_replica = true;
-      if (want_xlocked)
+      if (want_xlocked && !info.want_xlocked) {
+       if (!info.ancestors.empty()) {
+         CInode *diri = get_inode(info.ancestors[0].dirino);
+         if (diri) {
+           frag_t fg = diri->pick_dirfrag(info.ancestors[0].dname);
+           CDir *dir = diri->get_dirfrag(fg);
+           if (dir && !dir->is_auth())
+             discover_ino(dir, ino, NULL, true);
+         }
+       }
        info.want_xlocked = true;
+      }
     }
     info.waiters.push_back(fin);
   } else {