From: Kefu Chai Date: Sun, 20 Jul 2025 23:09:11 +0000 (+0800) Subject: auth: remove unused AuthTicket::renew_after member variable X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F64591%2Fhead;p=ceph.git auth: remove unused AuthTicket::renew_after member variable The AuthTicket::renew_after field is only set in init_timestamps() and read by dump() for debugging purposes. It has no functional use cases and causes encoding/decoding inconsistencies. During decoding, this field remains unchanged, creating discrepancies between original and decoded values. This issue was masked because check-generated.sh and readable.sh reused struct instances, preserving stale field values across encode/decode cycles. An upcoming change will allocate fresh instances for each decode operation, which would expose these inconsistent values. Remove the unused field to eliminate the encoding inconsistency and simplify the codebase. Signed-off-by: Kefu Chai --- diff --git a/doc/dev/cephx.rst b/doc/dev/cephx.rst index e060f7ec88e4..258c43e8cd28 100644 --- a/doc/dev/cephx.rst +++ b/doc/dev/cephx.rst @@ -163,7 +163,7 @@ where:: AuthTicket { EntityName name # client's identity, as proven by its possession of principal_secret u64 global_id # newly assigned, or from old_ticket - utime_t created, renew_after, expires + utime_t created, expires AuthCapsInfo # what client is allowed to do u32 flags = 0 # unused } @@ -258,7 +258,7 @@ Where, as above,:: AuthTicket { EntityName name u64 global_id - utime_t created, renew_after, expires + utime_t created, expires AuthCapsInfo # what you are allowed to do u32 flags = 0 # unused } diff --git a/src/auth/Auth.h b/src/auth/Auth.h index 2783b20f6eeb..590096bf93f6 100644 --- a/src/auth/Auth.h +++ b/src/auth/Auth.h @@ -136,7 +136,7 @@ WRITE_CLASS_ENCODER(AuthCapsInfo) struct AuthTicket { EntityName name; uint64_t global_id; /* global instance id */ - utime_t created, renew_after, expires; + utime_t created, expires; AuthCapsInfo caps; __u32 flags; @@ -146,8 +146,6 @@ struct AuthTicket { created = now; expires = now; expires += ttl; - renew_after = now; - renew_after += ttl / 2.0; } void encode(ceph::buffer::list& bl) const { @@ -181,7 +179,6 @@ struct AuthTicket { f->dump_object("name", name); f->dump_unsigned("global_id", global_id); f->dump_stream("created") << created; - f->dump_stream("renew_after") << renew_after; f->dump_stream("expires") << expires; f->dump_object("caps", caps); f->dump_unsigned("flags", flags);