]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix open_remote_inode race
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 19 Nov 2012 02:43:44 +0000 (10:43 +0800)
committerSage Weil <sage@inktank.com>
Sat, 1 Dec 2012 20:52:23 +0000 (12:52 -0800)
discover_ino() may return -ENOENT if it races with other FS activities.
so use C_MDC_RetryOpenRemoteIno instead of C_MDC_OpenRemoteIno as
onfinish callback.

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

index 399156ec837753c096c9ffef3c7411ef3019abaa..32799bde1093bdd9e2fc95deca54f0c4fdb6aa84 100644 (file)
@@ -7122,7 +7122,8 @@ void MDCache::open_remote_ino_2(inodeno_t ino,
   if (!dir && in->is_auth()) {
     if (in->is_frozen_dir()) {
       dout(7) << "traverse: " << *in << " is frozen_dir, waiting" << dendl;
-      in->parent->dir->add_waiter(CDir::WAIT_UNFREEZE, onfinish);
+      in->parent->dir->add_waiter(CDir::WAIT_UNFREEZE,
+                                 new C_MDC_RetryOpenRemoteIno(this, ino, onfinish));
       return;
     }
     dir = in->get_or_open_dirfrag(this, frag);
@@ -7157,7 +7158,7 @@ void MDCache::open_remote_ino_2(inodeno_t ino,
     dout(10) << "have remote dirfrag " << *dir << ", discovering " 
             << anchortrace[i].ino << dendl;
     discover_ino(dir, anchortrace[i].ino, 
-                new C_MDC_OpenRemoteIno(this, ino, anchortrace, onfinish));
+                new C_MDC_RetryOpenRemoteIno(this, ino, onfinish));
   }
 }