aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2010-04-30 18:51:44 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-01-11 15:04:10 -0500
commit77a3569d6c4e14e89fa628df383b6dccc0cce6be (patch)
tree3e89bd0aa2fe679ec212212bc232651f08ef7b2b /fs/nfsd/nfs4state.c
parentf0418aa4b1103f959d64dc18273efa04ee0140e9 (diff)
nfsd4: keep finer-grained callback status
Distinguish between when the callback channel is known to be down, and when it is not yet confirmed. This will be useful in the 4.1 case. Also, we don't seem to be using the fact that this field is atomic. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 290370bc9ae7..919ad25660d6 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1071,7 +1071,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir,
1071 1071
1072 memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); 1072 memcpy(clp->cl_recdir, recdir, HEXDIR_LEN);
1073 atomic_set(&clp->cl_refcount, 0); 1073 atomic_set(&clp->cl_refcount, 0);
1074 atomic_set(&clp->cl_cb_set, 0); 1074 clp->cl_cb_state = NFSD4_CB_UNKNOWN;
1075 INIT_LIST_HEAD(&clp->cl_idhash); 1075 INIT_LIST_HEAD(&clp->cl_idhash);
1076 INIT_LIST_HEAD(&clp->cl_strhash); 1076 INIT_LIST_HEAD(&clp->cl_strhash);
1077 INIT_LIST_HEAD(&clp->cl_openowners); 1077 INIT_LIST_HEAD(&clp->cl_openowners);
@@ -2003,7 +2003,6 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
2003 if (!same_creds(&conf->cl_cred, &unconf->cl_cred)) 2003 if (!same_creds(&conf->cl_cred, &unconf->cl_cred))
2004 status = nfserr_clid_inuse; 2004 status = nfserr_clid_inuse;
2005 else { 2005 else {
2006 atomic_set(&conf->cl_cb_set, 0);
2007 nfsd4_change_callback(conf, &unconf->cl_cb_conn); 2006 nfsd4_change_callback(conf, &unconf->cl_cb_conn);
2008 nfsd4_probe_callback(conf); 2007 nfsd4_probe_callback(conf);
2009 expire_client(unconf); 2008 expire_client(unconf);
@@ -2633,7 +2632,8 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_sta
2633{ 2632{
2634 struct nfs4_delegation *dp; 2633 struct nfs4_delegation *dp;
2635 struct nfs4_stateowner *sop = stp->st_stateowner; 2634 struct nfs4_stateowner *sop = stp->st_stateowner;
2636 int cb_up = atomic_read(&sop->so_client->cl_cb_set); 2635 /* XXX: or unknown and nfsv4.1: */
2636 int cb_up = (sop->so_client->cl_cb_state == NFSD4_CB_UP);
2637 struct file_lock *fl; 2637 struct file_lock *fl;
2638 int status, flag = 0; 2638 int status, flag = 0;
2639 2639
@@ -2823,7 +2823,7 @@ nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2823 renew_client(clp); 2823 renew_client(clp);
2824 status = nfserr_cb_path_down; 2824 status = nfserr_cb_path_down;
2825 if (!list_empty(&clp->cl_delegations) 2825 if (!list_empty(&clp->cl_delegations)
2826 && !atomic_read(&clp->cl_cb_set)) 2826 && clp->cl_cb_state != NFSD4_CB_UP)
2827 goto out; 2827 goto out;
2828 status = nfs_ok; 2828 status = nfs_ok;
2829out: 2829out: