From: Yan, Zheng Date: Wed, 15 Aug 2018 02:47:08 +0000 (+0800) Subject: mds: don't modify filepath when printing X-Git-Tag: v14.0.1~550^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0f057feac379fb49a1ed42948b489ceefccc15b8;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" --- diff --git a/src/include/filepath.h b/src/include/filepath.h index 09821b6ed371d..3fd75b1865c35 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();