From: Yan, Zheng Date: Wed, 15 Aug 2018 02:47:08 +0000 (+0800) Subject: mds: don't modify filepath when printing X-Git-Tag: v13.2.2~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cb166b1ff681d4f82d0876d4afaa891f5733af6c;p=ceph.git mds: don't modify filepath when printing filepath::depth() may call parse_bits(), which modifies mutable member 'bits'. dump_ops_in_flight asok command prints filepath without holding mds_lock. So multiple threads may call parse_bits() at the same time. Fixes: http://tracker.ceph.com/issues/26894 Signed-off-by: "Yan, Zheng" (cherry picked from commit 0f057feac379fb49a1ed42948b489ceefccc15b8) --- diff --git a/src/include/filepath.h b/src/include/filepath.h index 096e40388eaf..40f9c26fa6e8 100644 --- a/src/include/filepath.h +++ b/src/include/filepath.h @@ -227,7 +227,7 @@ inline ostream& operator<<(ostream& out, const filepath& path) { if (path.get_ino()) { out << '#' << path.get_ino(); - if (path.depth()) + if (path.length()) out << '/'; } return out << path.get_path();