On Tue, Jun 21, 2022 at 04:14:47PM +0200, Christian Brauner wrote: > +/** > + * kuid_eq_vfsuid - check whether kuid and vfsuid have the same value > + * @kuid: the kuid to compare > + * @vfsuid: the vfsuid to compare > + * > + * Check whether @kuid and @vfsuid have the same values. > + * > + * Return: true if @kuid and @vfsuid have the same value, false if not. > + */ > +static inline bool kuid_eq_vfsuid(kuid_t kuid, vfsuid_t vfsuid) > +{ > + return __vfsuid_val(vfsuid) == __kuid_val(kuid); > +} Something that I think would be helpful is if this and other comparison functions always returned false for comparisons with invalid, e.g.: static inline bool kuid_eq_vfsuid(kuid_t kuid, vfsuid_t vfsuid) { return vfsuid_valid(vfsuid) && __vfsuid_val(vfsuid) == __kuid_val(kuid); } I can't imagine any cases where we would want even two invalid ids to evaluate as being equal, and so as it is now we have to take great care to ensure that we never end up with comparisons between two invalid ids. Honestly I'd like to see that for kuid_t comparisons too, but I suppose that's a little out of scope here. Seth