diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 9c23696bf36bbfe0a8e1882e13a888738818d02a..d543222babf36beb28aba95afd746ddd9298d8ce 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1358,6 +1358,8 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, goto encode_op; } + fh_clear_wcc(current_fh); + /* If op is non-idempotent */ if (opdesc->op_flags & OP_MODIFIES_SOMETHING) { plen = opdesc->op_rsize_bop(rqstp, op); diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h index 4775bc4896c8b363123f852d1fd517f59fe7fd6e..ad67964d0bb198c0a516bb5adf10d31b060478f5 100644 --- a/fs/nfsd/nfsfh.h +++ b/fs/nfsd/nfsfh.h @@ -132,6 +132,17 @@ fh_init(struct svc_fh *fhp, int maxsize) } #ifdef CONFIG_NFSD_V3 +/* + * The wcc data stored in current_fh should be cleared + * between compound ops. + */ +static inline void +fh_clear_wcc(struct svc_fh *fhp) +{ + fhp->fh_post_saved = 0; + fhp->fh_pre_saved = 0; +} + /* * Fill in the pre_op attr for the wcc data */ @@ -152,7 +163,8 @@ fill_pre_wcc(struct svc_fh *fhp) extern void fill_post_wcc(struct svc_fh *); #else -#define fill_pre_wcc(ignored) +#define fh_clear_wcc(ignored) +#define fill_pre_wcc(ignored) #define fill_post_wcc(notused) #endif /* CONFIG_NFSD_V3 */