Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192381
b: refs/heads/master
c: 07cd490
h: refs/heads/master
i:
  192379: 9609a90
v: v3
  • Loading branch information
Benny Halevy authored and J. Bruce Fields committed May 13, 2010
1 parent 730ae5f commit c6bba65
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 46583e2597af649f134462d2f2c1be5e6689198d
refs/heads/master: 07cd4909a6c0c275ef42fd27748226975919e336
10 changes: 10 additions & 0 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,14 @@ free_session(struct kref *kref)
static inline void
renew_client_locked(struct nfs4_client *clp)
{
if (is_client_expired(clp)) {
dprintk("%s: client (clientid %08x/%08x) already expired\n",
__func__,
clp->cl_clientid.cl_boot,
clp->cl_clientid.cl_id);
return;
}

/*
* Move client to the end to the LRU list.
*/
Expand Down Expand Up @@ -697,6 +705,7 @@ free_client(struct nfs4_client *clp)
static inline void
unhash_client_locked(struct nfs4_client *clp)
{
mark_client_expired(clp);
list_del(&clp->cl_lru);
while (!list_empty(&clp->cl_sessions)) {
struct nfsd4_session *ses;
Expand Down Expand Up @@ -836,6 +845,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir,
INIT_LIST_HEAD(&clp->cl_delegations);
INIT_LIST_HEAD(&clp->cl_sessions);
INIT_LIST_HEAD(&clp->cl_lru);
clp->cl_time = get_seconds();
clear_bit(0, &clp->cl_cb_slot_busy);
rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table");
copy_verf(clp, verf);
Expand Down
14 changes: 13 additions & 1 deletion trunk/fs/nfsd/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ struct nfsd4_session {
struct list_head se_hash; /* hash by sessionid */
struct list_head se_perclnt;
u32 se_flags;
struct nfs4_client *se_client; /* for expire_client */
struct nfs4_client *se_client;
struct nfs4_sessionid se_sessionid;
struct nfsd4_channel_attrs se_fchannel;
struct nfsd4_channel_attrs se_bchannel;
Expand Down Expand Up @@ -244,6 +244,18 @@ struct nfs4_client {
/* wait here for slots */
};

static inline void
mark_client_expired(struct nfs4_client *clp)
{
clp->cl_time = 0;
}

static inline bool
is_client_expired(struct nfs4_client *clp)
{
return clp->cl_time == 0;
}

/* struct nfs4_client_reset
* one per old client. Populates reset_str_hashtbl. Filled from conf_id_hashtbl
* upon lease reset, or from upcall to state_daemon (to read in state
Expand Down

0 comments on commit c6bba65

Please sign in to comment.