]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: CInode::build_backtrace() always incr iter 147/head
authorSam Lang <sam.lang@inktank.com>
Tue, 26 Mar 2013 13:55:40 +0000 (08:55 -0500)
committerSam Lang <sam.lang@inktank.com>
Tue, 26 Mar 2013 16:14:52 +0000 (11:14 -0500)
Always increment the iterator when adding old pools
to the backtrace.  This fixes a bug on files where
the layout had been set to a different pool and then
back to the same pool, causing continuous looping in
the build_backtrace() function.

Fixes #4537.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
src/mds/CInode.cc

index 2744bfa40908c19a84d597fcdb41a4209a1ddcac..192222180ecadfabd4eb2fca70b42b90643c8bb9 100644 (file)
@@ -1018,8 +1018,10 @@ void CInode::build_backtrace(int64_t location, inode_backtrace_t* bt)
   vector<int64_t>::iterator i = inode.old_pools.begin();
   while(i != inode.old_pools.end()) {
     // don't add our own pool id to old_pools to avoid looping (e.g. setlayout 0, 1, 0)
-    if (*i == location)
+    if (*i == location) {
+      ++i;
       continue;
+    }
     bt->old_pools.insert(*i);
     ++i;
   }