From: Alex Ainscow Date: Thu, 27 Mar 2025 13:11:02 +0000 (+0000) Subject: osd: Fix some signing and typo issues in debug output X-Git-Tag: v20.3.0~29^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1e0d0b21b37b3736a5cb54c346a6df0a8bf38337;p=ceph.git osd: Fix some signing and typo issues in debug output Some dout messages contained unsigned shard ids. These should be signed, so that invalid shard ids show as -1, rather than max int. Also a very basic typo. Signed-off-by: Alex Ainscow --- diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 0301975cae36..4a6e21d1d509 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -211,7 +211,7 @@ ostream &operator<<(ostream &lhs, const pg_shard_t &rhs) return lhs << "?"; if (rhs.shard == shard_id_t::NO_SHARD) return lhs << rhs.get_osd(); - return lhs << rhs.get_osd() << '(' << (unsigned)(rhs.shard) << ')'; + return lhs << rhs.get_osd() << '(' << int(rhs.shard) << ')'; } void dump(Formatter* f, const osd_alerts_t& alerts) @@ -3689,7 +3689,7 @@ void pg_info_t::decode(ceph::buffer::list::const_iterator &bl) void pg_info_t::dump(Formatter *f) const { f->dump_stream("pgid") << pgid; - f->dump_stream("shared") << pgid.shard; + f->dump_stream("shard") << pgid.shard; f->dump_stream("last_update") << last_update; f->dump_stream("last_complete") << last_complete; f->dump_stream("log_tail") << log_tail; @@ -3820,8 +3820,8 @@ ostream &operator<<(ostream &lhs, const pg_notify_t ¬ify) << " " << notify.info; if (notify.from != shard_id_t::NO_SHARD || notify.to != shard_id_t::NO_SHARD) - lhs << " " << (unsigned)notify.from - << "->" << (unsigned)notify.to; + lhs << " " << int(notify.from) + << "->" << int(notify.to); lhs << " " << notify.past_intervals; return lhs << ")"; }