]> Pileus Git - ~andy/linux/blobdiff - fs/nfs/delegation.c
NFSv4: Rate limit the state manager for lock reclaim warning messages
[~andy/linux] / fs / nfs / delegation.c
index 12de88353eebe8736eef0cca8fd19be75041abe3..89af1d269274f3a91401f704226dec43f9c02528 100644 (file)
@@ -256,11 +256,14 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
                /*
                 * Deal with broken servers that hand out two
                 * delegations for the same file.
+                * Allow for upgrades to a WRITE delegation, but
+                * nothing else.
                 */
                dfprintk(FILE, "%s: server %s handed out "
                                "a duplicate delegation!\n",
                                __func__, clp->cl_hostname);
-               if (delegation->type <= old_delegation->type) {
+               if (delegation->type == old_delegation->type ||
+                   !(delegation->type & FMODE_WRITE)) {
                        freeme = delegation;
                        delegation = NULL;
                        goto out;