* [Cluster-devel] [GFS2 PATCH] GFS2: Allow glocks to be unlocked after withdraw
[not found] <2028298071.4441877.1493996350435.JavaMail.zimbra@redhat.com>
@ 2017-05-05 14:59 ` Bob Peterson
2017-05-05 15:38 ` Andreas Gruenbacher
0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2017-05-05 14:59 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Before this patch, glocks could not be unlocked after a withdraw,
but that resulted in hangs during unmount. This patch allows GFS2
function do_xmote to demote locks to an unlocked state, but not
promoting any upward.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 9e81219..959a19c 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -449,7 +449,8 @@ __acquires(&gl->gl_lockref.lock)
unsigned int lck_flags = (unsigned int)(gh ? gh->gh_flags : 0);
int ret;
- if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
+ if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) &&
+ target != LM_ST_UNLOCKED)
return;
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP |
LM_FLAG_PRIORITY);
@@ -486,7 +487,8 @@ __acquires(&gl->gl_lockref.lock)
}
else if (ret) {
pr_err("lm_lock ret %d\n", ret);
- GLOCK_BUG_ON(gl, 1);
+ GLOCK_BUG_ON(gl, !test_bit(SDF_SHUTDOWN,
+ &sdp->sd_flags));
}
} else { /* lock_nolock */
finish_xmote(gl, target);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [GFS2 PATCH] GFS2: Allow glocks to be unlocked after withdraw
2017-05-05 14:59 ` [Cluster-devel] [GFS2 PATCH] GFS2: Allow glocks to be unlocked after withdraw Bob Peterson
@ 2017-05-05 15:38 ` Andreas Gruenbacher
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Gruenbacher @ 2017-05-05 15:38 UTC (permalink / raw)
To: cluster-devel.redhat.com
Bob,
On Fri, May 5, 2017 at 4:59 PM, Bob Peterson <rpeterso@redhat.com> wrote:
> Hi,
>
> Before this patch, glocks could not be unlocked after a withdraw,
> but that resulted in hangs during unmount. This patch allows GFS2
> function do_xmote to demote locks to an unlocked state, but not
> promoting any upward.
the commit message should point out that this relates to commit 0d1c7ae9d8 which
currently is on for-next, so it fixes a regression and should probably end up in
this cycle as well.
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> ---
> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
> index 9e81219..959a19c 100644
> --- a/fs/gfs2/glock.c
> +++ b/fs/gfs2/glock.c
> @@ -449,7 +449,8 @@ __acquires(&gl->gl_lockref.lock)
> unsigned int lck_flags = (unsigned int)(gh ? gh->gh_flags : 0);
> int ret;
>
> - if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
> + if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) &&
> + target != LM_ST_UNLOCKED)
> return;
> lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP |
> LM_FLAG_PRIORITY);
> @@ -486,7 +487,8 @@ __acquires(&gl->gl_lockref.lock)
> }
> else if (ret) {
> pr_err("lm_lock ret %d\n", ret);
> - GLOCK_BUG_ON(gl, 1);
> + GLOCK_BUG_ON(gl, !test_bit(SDF_SHUTDOWN,
> + &sdp->sd_flags));
> }
> } else { /* lock_nolock */
> finish_xmote(gl, target);
Thanks,
Andreas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-05 15:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <2028298071.4441877.1493996350435.JavaMail.zimbra@redhat.com>
2017-05-05 14:59 ` [Cluster-devel] [GFS2 PATCH] GFS2: Allow glocks to be unlocked after withdraw Bob Peterson
2017-05-05 15:38 ` Andreas Gruenbacher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.