]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: pick head inode when caps follows is zero
authorYan, Zheng <zyan@redhat.com>
Sat, 14 Mar 2015 01:21:01 +0000 (09:21 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 18 Mar 2015 06:25:44 +0000 (14:25 +0800)
"caps follows is zero" means client does not flush anything, so
we shoud pick the head object

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/Locker.cc

index c51946715b376d4c70c332695f71399d7bab27ba..1744514662b58e1565d4a92688709690e91c050a 100644 (file)
@@ -2475,9 +2475,12 @@ void Locker::handle_client_caps(MClientCaps *m)
     mds->set_osd_epoch_barrier(m->osd_epoch_barrier);
   }
 
-  CInode *in = mdcache->pick_inode_snap(head_in, follows);
-  if (in != head_in)
-    dout(10) << " head inode " << *head_in << dendl;
+  CInode *in = head_in;
+  if (follows > 0) {
+    in = mdcache->pick_inode_snap(head_in, follows);
+    if (in != head_in)
+      dout(10) << " head inode " << *head_in << dendl;
+  }
   dout(10) << "  cap inode " << *in << dendl;
 
   Capability *cap = 0;