From: Kefu Chai Date: Wed, 2 Jun 2021 03:59:16 +0000 (+0800) Subject: auth/KeyRing: do not decode a copy of bl X-Git-Tag: v17.1.0~1747^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=594c5dc005a66497d495e154043c09bbcf963504;p=ceph.git auth/KeyRing: do not decode a copy of bl i checked all the code paths calling into KeyRing::decode(), none of them relies on the behavior that the bl is not mutated after the iterator is decoded. actually, it is more intuitive to always move the iterator forward when decoding the encoded keyring in the bufferlist. Signed-off-by: Kefu Chai --- diff --git a/src/auth/KeyRing.cc b/src/auth/KeyRing.cc index 6686fa9f51af4..d2e4cd391cf9e 100644 --- a/src/auth/KeyRing.cc +++ b/src/auth/KeyRing.cc @@ -203,8 +203,7 @@ void KeyRing::decode_plaintext(bufferlist::const_iterator& bli) void KeyRing::decode(bufferlist::const_iterator& bl) { - auto start_pos = bl; - decode_plaintext(start_pos); + decode_plaintext(bl); } int KeyRing::load(CephContext *cct, const std::string &filename)