revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36
[firefly-linux-kernel-4.4.55.git] / fs / nfsd / xdr4.h
index 60fce3dc5cb5d9f90d22b9f9c91ddc7ddeb9ff1d..4d476ff08ae6add1ec3a1b597909f1375af78b7b 100644 (file)
@@ -484,17 +484,18 @@ static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp)
 static inline void
 set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
 {
-       BUG_ON(!fhp->fh_pre_saved);
-       cinfo->atomic = fhp->fh_post_saved;
+       BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved);
+       cinfo->atomic = 1;
        cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode);
-
-       cinfo->before_change = fhp->fh_pre_change;
-       cinfo->after_change = fhp->fh_post_change;
-       cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
-       cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
-       cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
-       cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
-
+       if (cinfo->change_supported) {
+               cinfo->before_change = fhp->fh_pre_change;
+               cinfo->after_change = fhp->fh_post_change;
+       } else {
+               cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
+               cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
+               cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
+               cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
+       }
 }
 
 int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);