]> git.karo-electronics.de Git - linux-beck.git/blobdiff - fs/nfs/delegation.c
[PATCH] NFS: Fix cache consistency races
[linux-beck.git] / fs / nfs / delegation.c
index d7f7eb669d03ebfbdc492ee0d229390267a2f33d..4a36839f0bbdc7adb31dfdae9d8a739bc6a1b0ab 100644 (file)
@@ -85,6 +85,10 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
        struct nfs_delegation *delegation;
        int status = 0;
 
+       /* Ensure we first revalidate the attributes and page cache! */
+       if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR)))
+               __nfs_revalidate_inode(NFS_SERVER(inode), inode);
+
        delegation = nfs_alloc_delegation();
        if (delegation == NULL)
                return -ENOMEM;