aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2015-08-06 12:47:02 -0400
committerJ. Bruce Fields <bfields@redhat.com>2015-08-13 10:22:06 -0400
commitc87fb4a378f93f114b9906e180d83877cee4e7f4 (patch)
tree79af8260a9b9788247e37650fee5837799791723 /fs/nfsd/nfs4state.c
parent4bc6603778e473938ae815123b786e724084790c (diff)
lockd: NLM grace period shouldn't block NFSv4 opens
NLM locks don't conflict with NFSv4 share reservations, so we're not going to learn anything new by watiting for them. They do conflict with NFSv4 locks and with delegations. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 43903abd6189..c0c47a878cc6 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4065,7 +4065,8 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open,
4065 case NFS4_OPEN_CLAIM_FH: 4065 case NFS4_OPEN_CLAIM_FH:
4066 /* 4066 /*
4067 * Let's not give out any delegations till everyone's 4067 * Let's not give out any delegations till everyone's
4068 * had the chance to reclaim theirs.... 4068 * had the chance to reclaim theirs, *and* until
4069 * NLM locks have all been reclaimed:
4069 */ 4070 */
4070 if (locks_in_grace(clp->net)) 4071 if (locks_in_grace(clp->net))
4071 goto out_no_deleg; 4072 goto out_no_deleg;
@@ -4440,7 +4441,7 @@ check_special_stateids(struct net *net, svc_fh *current_fh, stateid_t *stateid,
4440{ 4441{
4441 if (ONE_STATEID(stateid) && (flags & RD_STATE)) 4442 if (ONE_STATEID(stateid) && (flags & RD_STATE))
4442 return nfs_ok; 4443 return nfs_ok;
4443 else if (locks_in_grace(net)) { 4444 else if (opens_in_grace(net)) {
4444 /* Answer in remaining cases depends on existence of 4445 /* Answer in remaining cases depends on existence of
4445 * conflicting state; so we must wait out the grace period. */ 4446 * conflicting state; so we must wait out the grace period. */
4446 return nfserr_grace; 4447 return nfserr_grace;
@@ -4459,7 +4460,7 @@ check_special_stateids(struct net *net, svc_fh *current_fh, stateid_t *stateid,
4459static inline int 4460static inline int
4460grace_disallows_io(struct net *net, struct inode *inode) 4461grace_disallows_io(struct net *net, struct inode *inode)
4461{ 4462{
4462 return locks_in_grace(net) && mandatory_lock(inode); 4463 return opens_in_grace(net) && mandatory_lock(inode);
4463} 4464}
4464 4465
4465/* Returns true iff a is later than b: */ 4466/* Returns true iff a is later than b: */
@@ -6578,6 +6579,7 @@ nfs4_state_start_net(struct net *net)
6578 return ret; 6579 return ret;
6579 nn->boot_time = get_seconds(); 6580 nn->boot_time = get_seconds();
6580 nn->grace_ended = false; 6581 nn->grace_ended = false;
6582 nn->nfsd4_manager.block_opens = true;
6581 locks_start_grace(net, &nn->nfsd4_manager); 6583 locks_start_grace(net, &nn->nfsd4_manager);
6582 nfsd4_client_tracking_init(net); 6584 nfsd4_client_tracking_init(net);
6583 printk(KERN_INFO "NFSD: starting %ld-second grace period (net %p)\n", 6585 printk(KERN_INFO "NFSD: starting %ld-second grace period (net %p)\n",