Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3235b403 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

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: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Tested-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 92d64e47
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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)
{
+1 −0
Original line number Diff line number Diff line
@@ -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);
}