Merge tag 'nfs-for-4.21-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
Pull NFS client updates from Anna Schumaker: "Stable bugfixes: - xprtrdma: Yet another double DMA-unmap # v4.20 Features: - Allow some /proc/sys/sunrpc entries without CONFIG_SUNRPC_DEBUG - Per-xprt rdma receive workqueues - Drop support for FMR memory registration - Make port= mount option optional for RDMA mounts Other bugfixes and cleanups: - Remove unused nfs4_xdev_fs_type declaration - Fix comments for behavior that has changed - Remove generic RPC credentials by switching to 'struct cred' - Fix crossing mountpoints with different auth flavors - Various xprtrdma fixes from testing and auditing the close code - Fixes for disconnect issues when using xprtrdma with krb5 - Clean up and improve xprtrdma trace points - Fix NFS v4.2 async copy reboot recovery" * tag 'nfs-for-4.21-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (63 commits) sunrpc: convert to DEFINE_SHOW_ATTRIBUTE sunrpc: Add xprt after nfs4_test_session_trunk() sunrpc: convert unnecessary GFP_ATOMIC to GFP_NOFS sunrpc: handle ENOMEM in rpcb_getport_async NFS: remove unnecessary test for IS_ERR(cred) xprtrdma: Prevent leak of rpcrdma_rep objects NFSv4.2 fix async copy reboot recovery xprtrdma: Don't leak freed MRs xprtrdma: Add documenting comment for rpcrdma_buffer_destroy xprtrdma: Replace outdated comment for rpcrdma_ep_post xprtrdma: Update comments in frwr_op_send SUNRPC: Fix some kernel doc complaints SUNRPC: Simplify defining common RPC trace events NFS: Fix NFSv4 symbolic trace point output xprtrdma: Trace mapping, alloc, and dereg failures xprtrdma: Add trace points for calls to transport switch methods xprtrdma: Relocate the xprtrdma_mr_map trace points xprtrdma: Clean up of xprtrdma chunk trace points xprtrdma: Remove unused fields from rpcrdma_ia xprtrdma: Cull dprintk() call sites ...
This commit is contained in:
@@ -1233,9 +1233,12 @@ int
|
||||
nfs_key_timeout_notify(struct file *filp, struct inode *inode)
|
||||
{
|
||||
struct nfs_open_context *ctx = nfs_file_open_context(filp);
|
||||
struct rpc_auth *auth = NFS_SERVER(inode)->client->cl_auth;
|
||||
|
||||
return rpcauth_key_timeout_notify(auth, ctx->cred);
|
||||
if (nfs_ctx_key_to_expire(ctx, inode) &&
|
||||
!ctx->ll_cred)
|
||||
/* Already expired! */
|
||||
return -EACCES;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1244,8 +1247,23 @@ nfs_key_timeout_notify(struct file *filp, struct inode *inode)
|
||||
bool nfs_ctx_key_to_expire(struct nfs_open_context *ctx, struct inode *inode)
|
||||
{
|
||||
struct rpc_auth *auth = NFS_SERVER(inode)->client->cl_auth;
|
||||
struct rpc_cred *cred = ctx->ll_cred;
|
||||
struct auth_cred acred = {
|
||||
.cred = ctx->cred,
|
||||
};
|
||||
|
||||
return rpcauth_cred_key_to_expire(auth, ctx->cred);
|
||||
if (cred && !cred->cr_ops->crmatch(&acred, cred, 0)) {
|
||||
put_rpccred(cred);
|
||||
ctx->ll_cred = NULL;
|
||||
cred = NULL;
|
||||
}
|
||||
if (!cred)
|
||||
cred = auth->au_ops->lookup_cred(auth, &acred, 0);
|
||||
if (!cred || IS_ERR(cred))
|
||||
return true;
|
||||
ctx->ll_cred = cred;
|
||||
return !!(cred->cr_ops->crkey_timeout &&
|
||||
cred->cr_ops->crkey_timeout(cred));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user