NFS: don't store 'struct cred *' in struct nfs_access_entry
Storing the 'struct cred *' in nfs_access_entry is problematic.
An active 'cred' can keep a 'struct key *' active, and a quota is
imposed on the number of such keys that a user can maintain.
Cached 'nfs_access_entry' structs have indefinite lifetime, and having
these keep 'struct key's alive imposes on that quota.
So remove the 'struct cred *' and replace it with the fields we need:
kuid_t, kgid_t, and struct group_info *
This makes the 'struct nfs_access_entry' 64 bits larger.
New function "access_cmp" is introduced which is identical to
cred_fscmp() except that the second arg is an 'nfs_access_entry', rather
than a 'cred'
Fixes: b68572e07c ("NFS: change access cache to use 'struct cred'.")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
committed by
Anna Schumaker
parent
73fbb3fa64
commit
6238aec83f
@@ -2653,7 +2653,6 @@ static int nfs4_opendata_access(const struct cred *cred,
|
||||
} else if ((fmode & FMODE_READ) && !opendata->file_created)
|
||||
mask = NFS4_ACCESS_READ;
|
||||
|
||||
cache.cred = cred;
|
||||
nfs_access_set_mask(&cache, opendata->o_res.access_result);
|
||||
nfs_access_add_cache(state->inode, &cache, cred);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user