mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 00:32:00 +00:00
cachefiles: avoid pointless cred reference count bump
The cache holds a long-term reference to the credentials that's taken when the cache is created and put when the cache becomes unused. Link: https://lore.kernel.org/r/20241125-work-cred-v2-27-68b9d38bb5b2@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
9e8534f5ae
commit
76a4008668
@ -393,13 +393,13 @@ extern int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
|
||||
static inline void cachefiles_begin_secure(struct cachefiles_cache *cache,
|
||||
const struct cred **_saved_cred)
|
||||
{
|
||||
*_saved_cred = override_creds(get_new_cred(cache->cache_cred));
|
||||
*_saved_cred = override_creds(cache->cache_cred);
|
||||
}
|
||||
|
||||
static inline void cachefiles_end_secure(struct cachefiles_cache *cache,
|
||||
const struct cred *saved_cred)
|
||||
{
|
||||
put_cred(revert_creds(saved_cred));
|
||||
revert_creds(saved_cred);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user