]> git.baikalelectronics.ru Git - kernel.git/commit
dlm: add __CHECKER__ for false positives
authorAlexander Aring <aahringo@redhat.com>
Mon, 4 Apr 2022 20:06:37 +0000 (16:06 -0400)
committerDavid Teigland <teigland@redhat.com>
Wed, 6 Apr 2022 19:02:20 +0000 (14:02 -0500)
commit94c56f3ace4ba2d4287a2f2766db57f5430c8169
tree1e44b49e50cb40dcdf0c64c28f10f25a8bcfe4d9
parentb0a016ee48a2ba181a58e9f1aa303bce8500d1bd
dlm: add __CHECKER__ for false positives

This patch will adds #ifndef __CHECKER__ for false positives warnings
about an imbalance lock/unlock srcu handling. Which are shown by running
sparse checks:

fs/dlm/midcomms.c:1065:20: warning: context imbalance in 'dlm_midcomms_get_mhandle' - wrong count at exit

Using __CHECKER__ will tell sparse to ignore these sections.

Those imbalances are false positive because from upper layer it is
always required to call a function in sequence, e.g. if
dlm_midcomms_get_mhandle() is successful there must be a
dlm_midcomms_commit_mhandle() call afterwards.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lowcomms.c
fs/dlm/midcomms.c