NFS: don't store 'struct cred *' in struct nfs_access_entry
authorNeilBrown <neilb@suse.de>
Mon, 27 Sep 2021 23:47:57 +0000 (09:47 +1000)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 6 Jan 2022 19:00:20 +0000 (14:00 -0500)
commit6238aec83f3fb12132f964937e5bbcf248fea8f9
tree1102e11d702034aee145eb5cab5d68f2261afb33
parent73fbb3fa647bdb5b60469af8101c741ece03a825
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: b68572e07c58 ("NFS: change access cache to use 'struct cred'.")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/dir.c
fs/nfs/nfs4proc.c
include/linux/nfs_fs.h