From 14cef276f1dcf58de7540d2b952224b794aaafa7 Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Tue, 26 Mar 2013 08:55:40 -0500 Subject: [PATCH] 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 --- src/mds/CInode.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.47.3