Skip to content

Commit 5d92311

Browse files
author
Andreas Gruenbacher
committed
gfs2: Fix "ignore unlock failures after withdraw"
Commit 3e11e53 tries to suppress dlm_lock() lock conversion errors that occur when the lockspace has already been released. It does that by setting and checking the SDF_SKIP_DLM_UNLOCK flag. This conflicts with the intended meaning of the SDF_SKIP_DLM_UNLOCK flag, so check whether the lockspace is still allocated instead. (Given the current DLM API, checking for this kind of error after the fact seems easier that than to make sure that the lockspace is still allocated before calling dlm_lock(). Changing the DLM API so that users maintain the lockspace references themselves would be an option.) Fixes: 3e11e53 ("GFS2: ignore unlock failures after withdraw") Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 262ee3a commit 5d92311

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

fs/gfs2/glock.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,11 +810,13 @@ __acquires(&gl->gl_lockref.lock)
810810
}
811811

812812
if (sdp->sd_lockstruct.ls_ops->lm_lock) {
813+
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
814+
813815
/* lock_dlm */
814816
ret = sdp->sd_lockstruct.ls_ops->lm_lock(gl, target, lck_flags);
815817
if (ret == -EINVAL && gl->gl_target == LM_ST_UNLOCKED &&
816818
target == LM_ST_UNLOCKED &&
817-
test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags)) {
819+
test_bit(DFL_UNMOUNT, &ls->ls_recover_flags)) {
818820
finish_xmote(gl, target);
819821
gfs2_glock_queue_work(gl, 0);
820822
} else if (ret) {

fs/gfs2/util.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ int gfs2_withdraw(struct gfs2_sbd *sdp)
350350
fs_err(sdp, "telling LM to unmount\n");
351351
lm->lm_unmount(sdp);
352352
}
353-
set_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags);
354353
fs_err(sdp, "File system withdrawn\n");
355354
dump_stack();
356355
clear_bit(SDF_WITHDRAW_IN_PROG, &sdp->sd_flags);

0 commit comments

Comments
 (0)