lkml.org 
[lkml]   [2024]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3] keys: update key quotas in key_put()
Date
David Howells <dhowells@redhat.com> writes:

> Luis Henriques <lhenriques@suse.de> wrote:
>
>> Delaying key quotas update when key's refcount reaches 0 in key_put() has
>> been causing some issues in fscrypt testing, specifically in fstest
>> generic/581. This commit fixes this test flakiness by dealing with the
>> quotas immediately, and leaving all the other clean-ups to the key garbage
>> collector.
>
> Okay, I'll accept this.
>

That's awesome, thanks a lot David. And, as Eric requested, I'll send out
shortly a follow-up fscrypt-specific patch, which will make generic/581
fstest finally pass.

Cheers,
--
Luís


>> This is done by moving the updates to the qnkeys and qnbytes fields in
>> struct key_user from key_gc_unused_keys() into key_put().
>> Unfortunately, this also means that we need to switch to the
>> irq-version of the spinlock that protects these fields and use
>> spin_lock_{irqsave,irqrestore} in all the code that touches these
>> fields.
>
> ... Which shouldn't be that often. It only happens when a key is created or
> finally let go of.
>
>> Signed-off-by: Luis Henriques <lhenriques@suse.de>
>
> Acked-by: David Howells <dhowells@redhat.com>
>
> Jarkko - could you pick this up?
>


\
 
 \ /
  Last update: 2024-05-27 14:49    [W:0.075 / U:3.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site