Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142201
b: refs/heads/master
c: e10e0cf
h: refs/heads/master
i:
  142199: c58f00f
v: v3
  • Loading branch information
Benny Halevy authored and J. Bruce Fields committed Apr 4, 2009
1 parent bb73c9d commit cb1615c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 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: bf864a31d50e3e94d6e76537b97d664913906ff8
refs/heads/master: e10e0cfc2f27364c73b28adbd3c8688d97049e73
29 changes: 28 additions & 1 deletion trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,34 @@ nfsd4_destroy_session(struct svc_rqst *r,
struct nfsd4_compound_state *cstate,
struct nfsd4_destroy_session *sessionid)
{
return -1; /* stub */
struct nfsd4_session *ses;
u32 status = nfserr_badsession;

/* Notes:
* - The confirmed nfs4_client->cl_sessionid holds destroyed sessinid
* - Should we return nfserr_back_chan_busy if waiting for
* callbacks on to-be-destroyed session?
* - Do we need to clear any callback info from previous session?
*/

dump_sessionid(__func__, &sessionid->sessionid);
spin_lock(&sessionid_lock);
ses = find_in_sessionid_hashtbl(&sessionid->sessionid);
if (!ses) {
spin_unlock(&sessionid_lock);
goto out;
}

unhash_session(ses);
spin_unlock(&sessionid_lock);

/* wait for callbacks */
shutdown_callback_client(ses->se_client);
nfsd4_put_session(ses);
status = nfs_ok;
out:
dprintk("%s returns %d\n", __func__, ntohl(status));
return status;
}

__be32
Expand Down
7 changes: 5 additions & 2 deletions trunk/fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,11 @@ static __be32
nfsd4_decode_destroy_session(struct nfsd4_compoundargs *argp,
struct nfsd4_destroy_session *destroy_session)
{
return nfserr_opnotsupp; /* stub */
DECODE_HEAD;
READ_BUF(NFS4_MAX_SESSIONID_LEN);
COPYMEM(destroy_session->sessionid.data, NFS4_MAX_SESSIONID_LEN);

DECODE_TAIL;
}

static __be32
Expand Down Expand Up @@ -2971,7 +2975,6 @@ static __be32
nfsd4_encode_destroy_session(struct nfsd4_compoundres *resp, int nfserr,
struct nfsd4_destroy_session *destroy_session)
{
/* stub */
return nfserr;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/nfsd/xdr4.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ struct nfsd4_sequence {
};

struct nfsd4_destroy_session {
int foo; /* stub */
struct nfs4_sessionid sessionid;
};

struct nfsd4_op {
Expand Down

0 comments on commit cb1615c

Please sign in to comment.