android_kernel_xiaomi_sm8350/fs/ocfs2/dlm
Sunil Mushran 7b791d6856 ocfs2/dlm: Fix race during lockres mastery
dlm_get_lock_resource() is supposed to return a lock resource with a proper
master. If multiple concurrent threads attempt to lookup the lockres for the
same lockid while the lock mastery in underway, one or more threads are likely
to return a lockres without a proper master.

This patch makes the threads wait in dlm_get_lock_resource() while the mastery
is underway, ensuring all threads return the lockres with a proper master.

This issue is known to be limited to users using the flock() syscall. For all
other fs operations, the ocfs2 dlmglue layer serializes the dlm op for each
lockid.

Users encountering this bug will see flock() return EINVAL and dmesg have the
following error:
ERROR: Dlm error "DLM_BADARGS" while calling dlmlock on resource <LOCKID>: bad api args

Reported-by: Coly Li <coyli@suse.de>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
2009-01-05 08:40:35 -08:00
..
dlmapi.h
dlmast.c ocfs2/dlm: Clean up errors in dlm_proxy_ast_handler() 2009-01-05 08:40:35 -08:00
dlmcommon.h ocfs2/dlm: Fix race in adding/removing lockres' to/from the tracking list 2009-01-05 08:40:35 -08:00
dlmconvert.c
dlmconvert.h
dlmdebug.c ocfs2/dlm: Fix race in adding/removing lockres' to/from the tracking list 2009-01-05 08:40:35 -08:00
dlmdebug.h
dlmdomain.c ocfs2/dlm: Fix race in adding/removing lockres' to/from the tracking list 2009-01-05 08:40:35 -08:00
dlmdomain.h
dlmfs.c Merge branch 'master' into next 2008-12-04 17:16:36 +11:00
dlmfsver.c
dlmfsver.h
dlmlock.c
dlmmaster.c ocfs2/dlm: Fix race during lockres mastery 2009-01-05 08:40:35 -08:00
dlmrecovery.c
dlmthread.c ocfs2/dlm: Hold off sending lockres drop ref message while lockres is migrating 2009-01-05 08:40:35 -08:00
dlmunlock.c
dlmver.c
dlmver.h
Makefile
userdlm.c
userdlm.h ocfs2: comments typo fix 2008-12-01 14:46:31 -08:00