From 0f057feac379fb49a1ed42948b489ceefccc15b8 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 15 Aug 2018 10:47:08 +0800 Subject: [PATCH] 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" --- src/include/filepath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); -- 2.39.5