]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't modify filepath when printing 23584/head
authorYan, Zheng <zyan@redhat.com>
Wed, 15 Aug 2018 02:47:08 +0000 (10:47 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 17 Aug 2018 01:26:55 +0000 (09:26 +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>
src/include/filepath.h

index 09821b6ed371db9a24d47b09d25c6e1c641a71b3..3fd75b1865c35e028b34116b03bd432af5d95fd6 100644 (file)
@@ -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();