aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 00a50b8ac878..408957cf6016 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2627,6 +2627,19 @@ nfs4_set_claim_prev(struct nfsd4_open *open)
2627 open->op_stateowner->so_client->cl_firststate = 1; 2627 open->op_stateowner->so_client->cl_firststate = 1;
2628} 2628}
2629 2629
2630/* Should we give out recallable state?: */
2631static bool nfsd4_cb_channel_good(struct nfs4_client *clp)
2632{
2633 if (clp->cl_cb_state == NFSD4_CB_UP)
2634 return true;
2635 /*
2636 * In the sessions case, since we don't have to establish a
2637 * separate connection for callbacks, we assume it's OK
2638 * until we hear otherwise:
2639 */
2640 return clp->cl_minorversion && clp->cl_cb_state == NFSD4_CB_UNKNOWN;
2641}
2642
2630/* 2643/*
2631 * Attempt to hand out a delegation. 2644 * Attempt to hand out a delegation.
2632 */ 2645 */
@@ -2635,11 +2648,11 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_sta
2635{ 2648{
2636 struct nfs4_delegation *dp; 2649 struct nfs4_delegation *dp;
2637 struct nfs4_stateowner *sop = stp->st_stateowner; 2650 struct nfs4_stateowner *sop = stp->st_stateowner;
2638 /* XXX: or unknown and nfsv4.1: */ 2651 int cb_up;
2639 int cb_up = (sop->so_client->cl_cb_state == NFSD4_CB_UP);
2640 struct file_lock *fl; 2652 struct file_lock *fl;
2641 int status, flag = 0; 2653 int status, flag = 0;
2642 2654
2655 cb_up = nfsd4_cb_channel_good(sop->so_client);
2643 flag = NFS4_OPEN_DELEGATE_NONE; 2656 flag = NFS4_OPEN_DELEGATE_NONE;
2644 open->op_recall = 0; 2657 open->op_recall = 0;
2645 switch (open->op_claim_type) { 2658 switch (open->op_claim_type) {