From: Sam Lang Date: Tue, 26 Mar 2013 13:55:40 +0000 (-0500) Subject: mds: CInode::build_backtrace() always incr iter X-Git-Tag: v0.60~10^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14cef276f1dcf58de7540d2b952224b794aaafa7;p=ceph.git mds: CInode::build_backtrace() always incr iter 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 --- diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 2744bfa40908..192222180eca 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -1018,8 +1018,10 @@ void CInode::build_backtrace(int64_t location, inode_backtrace_t* bt) vector::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; }