OrangePi_CM5/fs/gfs2
Bob Peterson 2225a5cd2f gfs2: Don't call dlm after protocol is unmounted
[ Upstream commit d1340f80f0b8066321b499a376780da00560e857 ]

In the gfs2 withdraw sequence, the dlm protocol is unmounted with a call
to lm_unmount. After a withdraw, users are allowed to unmount the
withdrawn file system. But at that point we may still have glocks left
over that we need to free via unmount's call to gfs2_gl_hash_clear.
These glocks may have never been completed because of whatever problem
caused the withdraw (IO errors or whatever).

Before this patch, function gdlm_put_lock would still try to call into
dlm to unlock these leftover glocks, which resulted in dlm returning
-EINVAL because the lock space was abandoned. These glocks were never
freed because there was no mechanism after that to free them.

This patch adds a check to gdlm_put_lock to see if the locking protocol
was inactive (DFL_UNMOUNT flag) and if so, free the glock and not
make the invalid call into dlm.

I could have combined this "if" with the one that follows, related to
leftover glock LVBs, but I felt the code was more readable with its own
if clause.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-18 13:40:30 +02:00
..
Kconfig
…
Makefile
…
acl.c
…
acl.h
…
aops.c
…
aops.h
…
bmap.c gfs2: Recursive gfs2_quota_hold in gfs2_iomap_end 2021-03-04 11:38:44 +01:00
bmap.h
…
dentry.c
…
dir.c
…
dir.h
…
export.c
…
file.c gfs2: Fix underflow in gfs2_page_mkwrite 2021-07-14 16:55:38 +02:00
gfs2.h
…
glock.c gfs2: Fix use-after-free in gfs2_glock_shrink_scan 2021-06-18 10:00:04 +02:00
glock.h
…
glops.c gfs2: Fix glock recursion in freeze_go_xmote_bh 2021-09-18 13:40:25 +02:00
glops.h
…
incore.h
…
inode.c
…
inode.h
…
lock_dlm.c gfs2: Don't call dlm after protocol is unmounted 2021-09-18 13:40:30 +02:00
log.c gfs2: fix use-after-free in trans_drain 2021-03-30 14:31:49 +02:00
log.h
…
lops.c
…
lops.h
…
main.c
…
meta_io.c
…
meta_io.h
…
ops_fstype.c gfs2: init system threads before freeze lock 2021-09-15 09:50:42 +02:00
quota.c
…
quota.h
…
recovery.c gfs2: Add common helper for holding and releasing the freeze glock 2021-03-25 09:04:14 +01:00
recovery.h
…
rgrp.c
…
rgrp.h
…
super.c gfs2: init system threads before freeze lock 2021-09-15 09:50:42 +02:00
super.h
…
sys.c
…
sys.h
…
trace_gfs2.h
…
trans.c gfs2: fix use-after-free in trans_drain 2021-03-30 14:31:49 +02:00
trans.h
…
util.c gfs2: bypass signal_our_withdraw if no journal 2021-03-25 09:04:14 +01:00
util.h gfs2: Add common helper for holding and releasing the freeze glock 2021-03-25 09:04:14 +01:00
xattr.c
…
xattr.h
…