]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: always pass pick_inode_snap the head
authorSage Weil <sage@newdream.net>
Fri, 17 Sep 2010 16:10:46 +0000 (09:10 -0700)
committerSage Weil <sage@newdream.net>
Thu, 23 Sep 2010 14:46:37 +0000 (07:46 -0700)
This fixes a possible infinite loop in handle_client_caps().  We need to
_always_ pass the head inode in.

src/mds/Locker.cc
src/mds/MDCache.cc

index cf2da38955551d6539a2e8126a2bf1079d761833..1005d2fe11312d4977288670e2bb1dcfbd118abf 100644 (file)
@@ -1832,7 +1832,7 @@ void Locker::handle_client_caps(MClientCaps *m)
       break;
     
     // next!
-    in = mdcache->pick_inode_snap(in, in->last);
+    in = mdcache->pick_inode_snap(head_in, in->last);
     cap = in->get_client_cap(client);
     assert(cap);    
   }
index 92da3351039152255c93c57e1e899060ae618d9f..209eafa3e95260fe2480ac6c21e1d877f61c5f24 100644 (file)
@@ -1221,6 +1221,7 @@ int MDCache::num_subtrees_fullnonauth()
 CInode *MDCache::pick_inode_snap(CInode *in, snapid_t follows)
 {
   dout(10) << "pick_inode_snap follows " << follows << " on " << *in << dendl;
+  assert(in->last == CEPH_NOSNAP);
 
   SnapRealm *realm = in->find_snaprealm();
   const set<snapid_t>& snaps = realm->get_snaps();