]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't modify filepath when printing 23672/head
authorYan, Zheng <zyan@redhat.com>
Wed, 15 Aug 2018 02:47:08 +0000 (10:47 +0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 28 Aug 2018 11:34:16 +0000 (13:34 +0200)
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 096e40388eafb9d131cda28ff408380465c7315b..40f9c26fa6e8fd60264d9fccdceeccda43077534 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();