|
@@ -4065,7 +4065,8 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open,
|
|
case NFS4_OPEN_CLAIM_FH:
|
|
case NFS4_OPEN_CLAIM_FH:
|
|
/*
|
|
/*
|
|
* Let's not give out any delegations till everyone's
|
|
* Let's not give out any delegations till everyone's
|
|
- * had the chance to reclaim theirs....
|
|
|
|
|
|
+ * had the chance to reclaim theirs, *and* until
|
|
|
|
+ * NLM locks have all been reclaimed:
|
|
*/
|
|
*/
|
|
if (locks_in_grace(clp->net))
|
|
if (locks_in_grace(clp->net))
|
|
goto out_no_deleg;
|
|
goto out_no_deleg;
|
|
@@ -4440,7 +4441,7 @@ check_special_stateids(struct net *net, svc_fh *current_fh, stateid_t *stateid,
|
|
{
|
|
{
|
|
if (ONE_STATEID(stateid) && (flags & RD_STATE))
|
|
if (ONE_STATEID(stateid) && (flags & RD_STATE))
|
|
return nfs_ok;
|
|
return nfs_ok;
|
|
- else if (locks_in_grace(net)) {
|
|
|
|
|
|
+ else if (opens_in_grace(net)) {
|
|
/* Answer in remaining cases depends on existence of
|
|
/* Answer in remaining cases depends on existence of
|
|
* conflicting state; so we must wait out the grace period. */
|
|
* conflicting state; so we must wait out the grace period. */
|
|
return nfserr_grace;
|
|
return nfserr_grace;
|
|
@@ -4459,7 +4460,7 @@ check_special_stateids(struct net *net, svc_fh *current_fh, stateid_t *stateid,
|
|
static inline int
|
|
static inline int
|
|
grace_disallows_io(struct net *net, struct inode *inode)
|
|
grace_disallows_io(struct net *net, struct inode *inode)
|
|
{
|
|
{
|
|
- return locks_in_grace(net) && mandatory_lock(inode);
|
|
|
|
|
|
+ return opens_in_grace(net) && mandatory_lock(inode);
|
|
}
|
|
}
|
|
|
|
|
|
/* Returns true iff a is later than b: */
|
|
/* Returns true iff a is later than b: */
|
|
@@ -6578,6 +6579,7 @@ nfs4_state_start_net(struct net *net)
|
|
return ret;
|
|
return ret;
|
|
nn->boot_time = get_seconds();
|
|
nn->boot_time = get_seconds();
|
|
nn->grace_ended = false;
|
|
nn->grace_ended = false;
|
|
|
|
+ nn->nfsd4_manager.block_opens = true;
|
|
locks_start_grace(net, &nn->nfsd4_manager);
|
|
locks_start_grace(net, &nn->nfsd4_manager);
|
|
nfsd4_client_tracking_init(net);
|
|
nfsd4_client_tracking_init(net);
|
|
printk(KERN_INFO "NFSD: starting %ld-second grace period (net %p)\n",
|
|
printk(KERN_INFO "NFSD: starting %ld-second grace period (net %p)\n",
|