nfsd41: save and restore current stateid with current fh
authorTigran Mkrtchyan <kofemann@gmail.com>
Mon, 13 Feb 2012 21:55:28 +0000 (22:55 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 15 Feb 2012 16:20:41 +0000 (11:20 -0500)
Signed-off-by: Tigran Mkrtchyan <kofemann@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/xdr4.h

index f1dd2702b8fd3e42c3e458e2adec83e8b8349ade..32a291af1b4e771b7c2bed066cb7198b40e7819e 100644 (file)
@@ -453,6 +453,7 @@ nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
                return nfserr_restorefh;
 
        fh_dup2(&cstate->current_fh, &cstate->save_fh);
+       cstate->current_stateid = cstate->save_stateid;
        return nfs_ok;
 }
 
@@ -464,6 +465,7 @@ nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
                return nfserr_nofilehandle;
 
        fh_dup2(&cstate->save_fh, &cstate->current_fh);
+       cstate->save_stateid = cstate->current_stateid;
        return nfs_ok;
 }
 
index b49ffe83e604c327f16ac00cafb5b244916f84e1..3c1ddd7f13a49068bbb71643da8d7f292c388ca8 100644 (file)
@@ -55,6 +55,7 @@ struct nfsd4_compound_state {
        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)