From: Willem Jan Withagen Date: Fri, 23 Oct 2020 23:41:17 +0000 (+0200) Subject: cephfs: Fix variable declartion in capture list in lambda X-Git-Tag: v16.1.0~764^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37776%2Fhead;p=ceph.git 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 --- 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()) {