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

Commit 1f71aa23 authored by Trond Myklebust's avatar Trond Myklebust Committed by Greg Kroah-Hartman
Browse files

nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0)




[ Upstream commit fb500a7cfee7f2f447d2bbf30cb59629feab6ac1 ]

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f2dc0da2
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@ static const stateid_t zero_stateid = {
static const stateid_t currentstateid = {
	.si_generation = 1,
};
static const stateid_t close_stateid = {
	.si_generation = 0xffffffffU,
};

static u64 current_sessionid = 1;

@@ -4901,6 +4904,11 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,

	nfsd4_close_open_stateid(stp);

	/* See RFC5661 sectionm 18.2.4 */
	if (stp->st_stid.sc_client->cl_minorversion)
		memcpy(&close->cl_stateid, &close_stateid,
				sizeof(close->cl_stateid));

	/* put reference from nfs4_preprocess_seqid_op */
	nfs4_put_stid(&stp->st_stid);
out: