Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309849
b: refs/heads/master
c: 631fc9e
h: refs/heads/master
i:
  309847: 50debf4
v: v3
  • Loading branch information
J. Bruce Fields committed Jun 1, 2012
1 parent 880bcac commit 9b776b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 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: 136e658d621f71b67982dda51a2327830146ef9d
refs/heads/master: 631fc9ea05c97e5d1d14ea58a7347be4857d09da
21 changes: 19 additions & 2 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,19 @@ nfsd4_set_ex_flags(struct nfs4_client *new, struct nfsd4_exchange_id *clid)
clid->flags = new->cl_exchange_flags;
}

static bool client_has_state(struct nfs4_client *clp)
{
/*
* Note clp->cl_openowners check isn't quite right: there's no
* need to count owners without stateid's.
*
* Also note we should probably be using this in 4.0 case too.
*/
return list_empty(&clp->cl_openowners)
&& list_empty(&clp->cl_delegations)
&& list_empty(&clp->cl_sessions);
}

__be32
nfsd4_exchange_id(struct svc_rqst *rqstp,
struct nfsd4_compound_state *cstate,
Expand Down Expand Up @@ -1576,15 +1589,19 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
goto out_copy;
}
if (!creds_match) { /* case 3 */
status = nfserr_clid_inuse;
goto out;
if (client_has_state(conf)) {
status = nfserr_clid_inuse;
goto out;
}
goto expire_client;
}
if (verfs_match) { /* case 2 */
exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;
new = conf;
goto out_copy;
}
/* case 5, client reboot */
expire_client:
expire_client(conf);
goto out_new;
}
Expand Down

0 comments on commit 9b776b6

Please sign in to comment.