]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dlm: warn about invalid nodeid comparsions
authorAlexander Aring <aahringo@redhat.com>
Fri, 2 Aug 2024 17:26:41 +0000 (13:26 -0400)
committerDavid Teigland <teigland@redhat.com>
Thu, 8 Aug 2024 20:15:07 +0000 (15:15 -0500)
commitd47b822974b8d4da6f22be5341afd4ce6bca6a9f
treeeb50b4b65c2fb871c696a385e4c3340530f25514
parent90ad918e371fcb7ea4cb6c0a391acc6bba51662e
dlm: warn about invalid nodeid comparsions

This patch adds a warn on if is_master() and dlm_is_removed() checks on
invalid nodeid states that are probably not what the caller wants to do
here. The is_master() function checking on r->res_nodeid is invalid when
it is set to -1, whereas the dlm_is_removed() has a different meaning
as "nodeid member" and also 0 is invalid.

We run into these cases and this patch changes those cases as we never
will run into them. There should be no functional changes as the
condition should return the same result. However this patch signals now
on caller level that there might be an "extra" case to handle here.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lock.c
fs/dlm/lock.h
fs/dlm/member.c
fs/dlm/recover.c