android_kernel_motorola_sm6375/fs/dlm
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alexander Aring 17ea634849 dlm: fix missing lkb refcount handling
commit 1689c169134f4b5a39156122d799b7dca76d8ddb upstream.

We always call hold_lkb(lkb) if we increment lkb->lkb_wait_count.
So, we always need to call unhold_lkb(lkb) if we decrement
lkb->lkb_wait_count. This patch will add missing unhold_lkb(lkb) if we
decrement lkb->lkb_wait_count. In case of setting lkb->lkb_wait_count to
zero we need to countdown until reaching zero and call unhold_lkb(lkb).
The waiters list unhold_lkb(lkb) can be removed because it's done for
the last lkb_wait_count decrement iteration as it's done in
_remove_from_waiters().

This issue was discovered by a dlm gfs2 test case which use excessively
dlm_unlock(LKF_CANCEL) feature. Probably the lkb->lkb_wait_count value
never reached above 1 if this feature isn't used and so it was not
discovered before.

The testcase ended in a rsb on the rsb keep data structure with a
refcount of 1 but no lkb was associated with it, which is itself
an invalid behaviour. A side effect of that was a condition in which
the dlm was sending remove messages in a looping behaviour. With this
patch that has not been reproduced.

Cc: [email protected]
Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: David Teigland <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-14 18:11:46 +02:00
..
ast.c
ast.h
config.c fs: dlm: fix memory leak when fenced 2021-07-14 16:53:17 +02:00
config.h
debug_fs.c fs: dlm: fix debugfs dump 2021-05-19 10:08:20 +02:00
dir.c
dir.h
dlm_internal.h dlm: remove BUG() before panic() 2020-06-24 17:50:26 +02:00
Kconfig
lock.c dlm: fix missing lkb refcount handling 2022-06-14 18:11:46 +02:00
lock.h
lockspace.c dlm: Fix kobject memleak 2020-08-19 08:16:21 +02:00
lockspace.h
lowcomms.c fs: dlm: cancel work sync othercon 2021-07-14 16:53:17 +02:00
lowcomms.h
lvb_table.h
main.c
Makefile
member.c
member.h
memory.c
memory.h
midcomms.c
midcomms.h
netlink.c
plock.c dlm: fix plock invalid read 2022-06-14 18:11:46 +02:00
rcom.c
rcom.h
recover.c
recover.h
recoverd.c
recoverd.h
requestqueue.c
requestqueue.h
user.c
user.h
util.c
util.h