mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 05:10:51 +07:00
NFSv4: Ensure the delegation cred is pinned when we call delegreturn
Ensure we don't release the delegation cred during the call to
nfs4_proc_delegreturn().
Fixes: ee05f45677
("NFSv4: Fix races between open and delegreturn")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
8c75593c6e
commit
5d63944f82
@ -255,13 +255,18 @@ void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred,
|
||||
|
||||
static int nfs_do_return_delegation(struct inode *inode, struct nfs_delegation *delegation, int issync)
|
||||
{
|
||||
const struct cred *cred;
|
||||
int res = 0;
|
||||
|
||||
if (!test_bit(NFS_DELEGATION_REVOKED, &delegation->flags))
|
||||
res = nfs4_proc_delegreturn(inode,
|
||||
delegation->cred,
|
||||
if (!test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) {
|
||||
spin_lock(&delegation->lock);
|
||||
cred = get_cred(delegation->cred);
|
||||
spin_unlock(&delegation->lock);
|
||||
res = nfs4_proc_delegreturn(inode, cred,
|
||||
&delegation->stateid,
|
||||
issync);
|
||||
put_cred(cred);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user