NFSv4: Add attribute update barriers to delegreturn and pNFS layoutcommit
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 26 Feb 2015 22:54:58 +0000 (17:54 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 2 Mar 2015 04:23:06 +0000 (23:23 -0500)
Ensure that other operations that race with delegreturn and layoutcommit
cannot revert the attribute updates that were made on the server.

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

index ff9a6795da46c0a05c8b5ddc9a78b07ef373fb6f..cd094d6521993fc5e1376e742820f160de5cb76b 100644 (file)
@@ -1555,6 +1555,7 @@ int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fa
        int status;
 
        spin_lock(&inode->i_lock);
+       nfs_fattr_set_barrier(fattr);
        status = nfs_post_op_update_inode_force_wcc_locked(inode, fattr);
        spin_unlock(&inode->i_lock);
        return status;