aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-02-26 19:52:06 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-03-01 23:23:06 -0500
commit3235b40303b6f609c446275d0e7f6f9f4fe94156 (patch)
treec1cf48ebf29dbf8320b3aea4b63e60674d870748 /fs/nfs
parent92d64e47b67b5e7fe1b5358402ab222a32ec3479 (diff)
NFSv4: Set a barrier in the update_changeattr() helper
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>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/inode.c1
-rw-r--r--fs/nfs/nfs4proc.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index c66c1df467f4..5026c44a98e1 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1249,6 +1249,7 @@ unsigned long nfs_inc_attr_generation_counter(void)
1249{ 1249{
1250 return atomic_long_inc_return(&nfs_attr_generation_counter); 1250 return atomic_long_inc_return(&nfs_attr_generation_counter);
1251} 1251}
1252EXPORT_SYMBOL_GPL(nfs_inc_attr_generation_counter);
1252 1253
1253void nfs_fattr_init(struct nfs_fattr *fattr) 1254void nfs_fattr_init(struct nfs_fattr *fattr)
1254{ 1255{
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b022e64b76a5..a211daf58c32 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -901,6 +901,7 @@ static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo)
901 if (!cinfo->atomic || cinfo->before != dir->i_version) 901 if (!cinfo->atomic || cinfo->before != dir->i_version)
902 nfs_force_lookup_revalidate(dir); 902 nfs_force_lookup_revalidate(dir);
903 dir->i_version = cinfo->after; 903 dir->i_version = cinfo->after;
904 nfsi->attr_gencount = nfs_inc_attr_generation_counter();
904 nfs_fscache_invalidate(dir); 905 nfs_fscache_invalidate(dir);
905 spin_unlock(&dir->i_lock); 906 spin_unlock(&dir->i_lock);
906} 907}