Commit df2c7b95 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFSv4: setlease should return EAGAIN if locks are not available



Instead of returning ENOLCK when we can't hand out a lease, we should be
returning EAGAIN.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent e97bc663
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -7452,13 +7452,13 @@ static int nfs4_add_lease(struct file *file, long arg, struct file_lock **lease,


	/* No delegation, no lease */
	/* No delegation, no lease */
	if (!nfs4_have_delegation(inode, type))
	if (!nfs4_have_delegation(inode, type))
		return -ENOLCK;
		return -EAGAIN;
	ret = generic_setlease(file, arg, lease, priv);
	ret = generic_setlease(file, arg, lease, priv);
	if (ret || nfs4_have_delegation(inode, type))
	if (ret || nfs4_have_delegation(inode, type))
		return ret;
		return ret;
	/* We raced with a delegation return */
	/* We raced with a delegation return */
	nfs4_delete_lease(file, priv);
	nfs4_delete_lease(file, priv);
	return -ENOLCK;
	return -EAGAIN;
}
}


int nfs4_proc_setlease(struct file *file, long arg, struct file_lock **lease,
int nfs4_proc_setlease(struct file *file, long arg, struct file_lock **lease,