Submitted as: https://github.com/ceph/ceph/pull/41235 commit 953e7dc0f911f84a4bb377aee45b22e2ffad6867 Author: Duncan Bellamy Date: Sat May 8 11:52:35 2021 +0100 mds: PurgeQueue.cc add static cast for 32bit compilation files_high_water is defined as uint64_t but when compiling on 32bit these max functions fail as they are both not considered uint64_t by gcc 10 even though they are files_high_water = std::max(files_high_water, static_cast(in_flight.size())); Fixes: https://tracker.ceph.com/issues/50707 Signed-off-by: Duncan Bellamy diff --git a/src/mds/PurgeQueue.cc b/src/mds/PurgeQueue.cc index 977be2c118..3104a3ccc4 100644 --- a/src/mds/PurgeQueue.cc +++ b/src/mds/PurgeQueue.cc @@ -7,9 +7,9 @@ * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software + * License version 2.1, as published by the Free Software * Foundation. See file COPYING. - * + * */ #include "common/debug.h" @@ -594,8 +594,8 @@ void PurgeQueue::_execute_item( in_flight[expire_to] = item; logger->set(l_pq_executing, in_flight.size()); - files_high_water = std::max(files_high_water, - static_cast(in_flight.size())); + files_high_water = std::max(files_high_water, + in_flight.size()); logger->set(l_pq_executing_high_water, files_high_water); auto ops = _calculate_ops(item); ops_in_flight += ops; @@ -662,8 +662,8 @@ void PurgeQueue::_execute_item( logger->set(l_pq_executing_ops_high_water, ops_high_water); in_flight.erase(expire_to); logger->set(l_pq_executing, in_flight.size()); - files_high_water = std::max(files_high_water, - static_cast(in_flight.size())); + files_high_water = std::max(files_high_water, + in_flight.size()); logger->set(l_pq_executing_high_water, files_high_water); return; } @@ -716,19 +716,19 @@ void PurgeQueue::_execute_item_complete( in_flight.erase(iter); logger->set(l_pq_executing, in_flight.size()); - files_high_water = std::max(files_high_water, - static_cast(in_flight.size())); + files_high_water = std::max(files_high_water, + in_flight.size()); logger->set(l_pq_executing_high_water, files_high_water); dout(10) << "in_flight.size() now " << in_flight.size() << dendl; - uint64_t write_pos = journaler.get_write_pos(); - uint64_t read_pos = journaler.get_read_pos(); - uint64_t expire_pos = journaler.get_expire_pos(); - uint64_t item_num = (write_pos - (in_flight.size() ? expire_pos : read_pos)) + uint64_t write_pos = journaler.get_write_pos(); + uint64_t read_pos = journaler.get_read_pos(); + uint64_t expire_pos = journaler.get_expire_pos(); + uint64_t item_num = (write_pos - (in_flight.size() ? expire_pos : read_pos)) / purge_item_journal_size; - dout(10) << "left purge items in journal: " << item_num - << " (purge_item_journal_size/write_pos/read_pos/expire_pos) now at " - << "(" << purge_item_journal_size << "/" << write_pos << "/" << read_pos + dout(10) << "left purge items in journal: " << item_num + << " (purge_item_journal_size/write_pos/read_pos/expire_pos) now at " + << "(" << purge_item_journal_size << "/" << write_pos << "/" << read_pos << "/" << expire_pos << ")" << dendl; logger->set(l_pq_item_in_journal, item_num);