mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
fs: dlm: change dflags to use atomic bits
Currently manipulating lkb_dflags assumes to held the rsb lock assigned to the lkb. This is held by dlm message processing after certain time to lookup the right rsb from the received lkb message id. For user space locks flags, which is currently the only use case for lkb_dflags, flags are also being set during dlm character device handling without holding the rsb lock. To minimize the risk that bit operations are getting corrupted we switch to atomic bit operations. This patch will also introduce helpers to snapshot atomic bit values in an non atomic way. There might be still issues with the flag handling e.g. running in case of manipulating bit ops and snapshot them at the same time, but this patch minimize them and will start to use atomic bit operations. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
committed by
David Teigland
parent
8c11ba64ce
commit
8a39dcd9c3
@@ -170,7 +170,7 @@ static void print_format2_lock(struct seq_file *s, struct dlm_lkb *lkb,
|
||||
u64 xid = 0;
|
||||
u64 us;
|
||||
|
||||
if (lkb->lkb_dflags & DLM_DFL_USER) {
|
||||
if (test_bit(DLM_DFL_USER_BIT, &lkb->lkb_dflags)) {
|
||||
if (lkb->lkb_ua)
|
||||
xid = lkb->lkb_ua->xid;
|
||||
}
|
||||
@@ -230,7 +230,7 @@ static void print_format3_lock(struct seq_file *s, struct dlm_lkb *lkb,
|
||||
{
|
||||
u64 xid = 0;
|
||||
|
||||
if (lkb->lkb_dflags & DLM_DFL_USER) {
|
||||
if (test_bit(DLM_DFL_USER_BIT, &lkb->lkb_dflags)) {
|
||||
if (lkb->lkb_ua)
|
||||
xid = lkb->lkb_ua->xid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user