Skip to content

Commit

Permalink
nfsd: fix bug on nfs4 stateid deallocation
Browse files Browse the repository at this point in the history
NFS4_OO_PURGE_CLOSE is not handled properly. To avoid memory leak, nfs4
stateid which is pointed by oo_last_closed_stid is freed in nfsd4_close(),
but NFS4_OO_PURGE_CLOSE isn't cleared meanwhile. So the stateid released in
THIS close procedure may be freed immediately in the coming encoding function.
Sorry that Signed-off-by was forgotten in last version.

Signed-off-by: Yanchuan Nian <ycnian@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
ycnian@gmail.com authored and J. Bruce Fields committed Apr 3, 2013
1 parent 9c6bdbb commit 491402a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -3823,6 +3823,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,

nfsd4_close_open_stateid(stp);
release_last_closed_stateid(oo);
oo->oo_flags &= ~NFS4_OO_PURGE_CLOSE;
oo->oo_last_closed_stid = stp;

if (list_empty(&oo->oo_owner.so_stateids)) {
Expand Down

0 comments on commit 491402a

Please sign in to comment.