]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't modify filepath when printing 23677/head
authorYan, Zheng <zyan@redhat.com>
Wed, 15 Aug 2018 02:47:08 +0000 (10:47 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 22 Aug 2018 02:31:26 +0000 (10:31 +0800)
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" <zyan@redhat.com>
(cherry picked from commit 0f057feac379fb49a1ed42948b489ceefccc15b8)

src/include/filepath.h

index 8439b3fc985412fbb5a48511af79af75276133b1..ff4b749ba26ea4d830661764e90f484746adb807 100644 (file)
@@ -226,7 +226,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();