]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/cdir: limit max snap id in lookup() 9421/head
authorhuanwen ren <rhwlyw@163.com>
Wed, 1 Jun 2016 09:28:56 +0000 (17:28 +0800)
committerhuanwen ren <ren.huanwen@zte.com.cn>
Wed, 1 Jun 2016 09:29:11 +0000 (17:29 +0800)
If you give more than Snapid of dentry.last, then you can get dentry
It's not reasonable, I fix it

Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
src/mds/CDir.cc

index 3f47918c9ed8757ba25dd325ba6f09a934dfe238..bfee24e31feb69b5478c72474383b45287d800c9 100644 (file)
@@ -302,7 +302,8 @@ CDentry *CDir::lookup(const char *name, snapid_t snap)
   if (iter == items.end())
     return 0;
   if (iter->second->name == name &&
-      iter->second->first <= snap) {
+      iter->second->first <= snap &&
+      iter->second->last >= snap) {
     dout(20) << "  hit -> " << iter->first << dendl;
     return iter->second;
   }