]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: Fix variable declartion in capture list in lambda 37776/head
authorWillem Jan Withagen <wjw@digiware.nl>
Fri, 23 Oct 2020 23:41:17 +0000 (01:41 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Fri, 23 Oct 2020 23:53:14 +0000 (01:53 +0200)
/home/jenkins/workspace/ceph-master-compile/src/tools/cephfs_mirror/Mirror.cc:529:33: error: 'mirror_action' in capture list does not name a variable
    m_cond.wait(locker, [this, &mirror_action] {return !mirror_action.action_in_progress;});
                                ^
/home/jenkins/workspace/ceph-master-compile/src/tools/cephfs_mirror/Mirror.cc:529:57: error: reference to local binding 'mirror_action' declared in enclosing function 'cephfs::mirror::Mirror::run'
    m_cond.wait(locker, [this, &mirror_action] {return !mirror_action.action_in_progress;});
                                                        ^
/home/jenkins/workspace/ceph-master-compile/src/tools/cephfs_mirror/Mirror.cc:526:27: note: 'mirror_action' declared here
  for (auto &[filesystem, mirror_action] : m_mirror_actions) {
                          ^
/home/jenkins/workspace/ceph-master-compile/src/tools/cephfs_mirror/Mirror.cc:529:26: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
    m_cond.wait(locker, [this, &mirror_action] {return !mirror_action.action_in_progress;});
                         ^~~~
1 warning and 2 errors generated.

Tracker: https://tracker.ceph.com/issues/47973
Fixes: https://github.com/ceph/ceph/pull/37313
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/tools/cephfs_mirror/Mirror.cc

index be56817c06181a165181e8c29a4710f19804c305..c63d1b4229409a78d3cbc4c4fd3163b552f10b3c 100644 (file)
@@ -526,7 +526,8 @@ void Mirror::run() {
   for (auto &[filesystem, mirror_action] : m_mirror_actions) {
     dout(10) << ": trying to shutdown filesystem=" << filesystem << dendl;
     // wait for in-progress action and shutdown
-    m_cond.wait(locker, [this, &mirror_action] {return !mirror_action.action_in_progress;});
+    m_cond.wait(locker, [&mirror_action=mirror_action] 
+                {return !mirror_action.action_in_progress;});
     if (mirror_action.fs_mirror &&
         !mirror_action.fs_mirror->is_stopping() &&
         !mirror_action.fs_mirror->is_failed()) {