Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 491402a7 authored by ycnian@gmail.com's avatar ycnian@gmail.com Committed by J. Bruce Fields
Browse files

nfsd: fix bug on nfs4 stateid deallocation



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: default avatarYanchuan Nian <ycnian@gmail.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 9c6bdbb8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -3823,6 +3823,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,


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


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