diff options
author | J. Bruce Fields <bfields@redhat.com> | 2015-08-06 12:47:02 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2015-08-13 10:22:06 -0400 |
commit | c87fb4a378f93f114b9906e180d83877cee4e7f4 (patch) | |
tree | 79af8260a9b9788247e37650fee5837799791723 /fs/nfs_common | |
parent | 4bc6603778e473938ae815123b786e724084790c (diff) | |
download | linux-c87fb4a378f93f114b9906e180d83877cee4e7f4.tar.bz2 |
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/nfs_common')
-rw-r--r-- | fs/nfs_common/grace.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/fs/nfs_common/grace.c b/fs/nfs_common/grace.c index ae6e58ea4de5..fd8c9a5bcac4 100644 --- a/fs/nfs_common/grace.c +++ b/fs/nfs_common/grace.c @@ -63,14 +63,33 @@ EXPORT_SYMBOL_GPL(locks_end_grace); * lock reclaims. */ int -locks_in_grace(struct net *net) +__state_in_grace(struct net *net, bool open) { struct list_head *grace_list = net_generic(net, grace_net_id); + struct lock_manager *lm; - return !list_empty(grace_list); + if (!open) + return !list_empty(grace_list); + + list_for_each_entry(lm, grace_list, list) { + if (lm->block_opens) + return true; + } + return false; +} + +int locks_in_grace(struct net *net) +{ + return __state_in_grace(net, 0); } EXPORT_SYMBOL_GPL(locks_in_grace); +int opens_in_grace(struct net *net) +{ + return __state_in_grace(net, 1); +} +EXPORT_SYMBOL_GPL(opens_in_grace); + static int __net_init grace_init_net(struct net *net) { |