]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFSv4: Set a barrier in the update_changeattr() helper
authorTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 27 Feb 2015 00:52:06 +0000 (19:52 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 2 Mar 2015 04:23:06 +0000 (23:23 -0500)
Ensure that we don't regress the changes that were made to the
directory.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfs/inode.c
fs/nfs/nfs4proc.c

index c66c1df467f4a51970ffd2c2a21b58867c26c3b0..5026c44a98e1c11f924221d8a8c7fc75ffa68d6e 100644 (file)
@@ -1249,6 +1249,7 @@ unsigned long nfs_inc_attr_generation_counter(void)
 {
        return atomic_long_inc_return(&nfs_attr_generation_counter);
 }
+EXPORT_SYMBOL_GPL(nfs_inc_attr_generation_counter);
 
 void nfs_fattr_init(struct nfs_fattr *fattr)
 {
index b022e64b76a52f7c53b20229b6dd5625aef018c0..a211daf58c328e8c8a03053ccc0218f3582900a7 100644 (file)
@@ -901,6 +901,7 @@ static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo)
        if (!cinfo->atomic || cinfo->before != dir->i_version)
                nfs_force_lookup_revalidate(dir);
        dir->i_version = cinfo->after;
+       nfsi->attr_gencount = nfs_inc_attr_generation_counter();
        nfs_fscache_invalidate(dir);
        spin_unlock(&dir->i_lock);
 }