From 77f2f88dcbbc44280a2c4cc1e7c4c8055966fad3 Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Sat, 24 Oct 2020 01:41:17 +0200 Subject: [PATCH] cephfs: Fix variable declartion in capture list in lambda /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 --- src/tools/cephfs_mirror/Mirror.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/cephfs_mirror/Mirror.cc b/src/tools/cephfs_mirror/Mirror.cc index be56817c0618..c63d1b422940 100644 --- a/src/tools/cephfs_mirror/Mirror.cc +++ b/src/tools/cephfs_mirror/Mirror.cc @@ -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()) { -- 2.47.3