summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2012-11-19 10:43:44 +0800
committerSage Weil <sage@inktank.com>2012-12-01 12:52:23 -0800
commit961bc0c93642bdd4f4aa59ea853ef13b4c11287f (patch)
tree09b198d1ca0db873c86d0ab316163ab936b630a4
parent3fa2582b0b4164320180462a57115d2a2d1c4deb (diff)
downloadceph-961bc0c93642bdd4f4aa59ea853ef13b4c11287f.tar.gz
mds: fix open_remote_inode race
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>
-rw-r--r--src/mds/MDCache.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index 399156ec837..32799bde109 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -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));
}
}