nfsd41: save and restore current stateid with current fh
Signed-off-by: Tigran Mkrtchyan <kofemann@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index f1dd270..32a291a 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -453,6 +453,7 @@
return nfserr_restorefh;
fh_dup2(&cstate->current_fh, &cstate->save_fh);
+ cstate->current_stateid = cstate->save_stateid;
return nfs_ok;
}
@@ -464,6 +465,7 @@
return nfserr_nofilehandle;
fh_dup2(&cstate->save_fh, &cstate->current_fh);
+ cstate->save_stateid = cstate->current_stateid;
return nfs_ok;
}
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index b49ffe8..3c1ddd7 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -55,6 +55,7 @@
u32 minorversion;
u32 status;
const stateid_t *current_stateid;
+ const stateid_t *save_stateid;
};
static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs)