Skip to content

Commit 7a5e9f1

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: fix building without lockdep
This patch uses assert_spin_locked() instead of lockdep_is_held() where it's available to use because lockdep_is_held() is only available if CONFIG_LOCKDEP is set. In other cases like lockdep_sock_is_held() we surround it by a CONFIG_LOCKDEP idef. Fixes: dbb751f ("fs: dlm: parallelize lowcomms socket handling") Reported-by: kernel test robot <[email protected]> Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent dbb751f commit 7a5e9f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/dlm/lowcomms.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ bool dlm_lowcomms_is_running(void)
208208

209209
static void lowcomms_queue_swork(struct connection *con)
210210
{
211-
WARN_ON_ONCE(!lockdep_is_held(&con->writequeue_lock));
211+
assert_spin_locked(&con->writequeue_lock);
212212

213213
if (!test_bit(CF_IO_STOP, &con->flags) &&
214214
!test_bit(CF_APP_LIMITED, &con->flags) &&
@@ -218,7 +218,9 @@ static void lowcomms_queue_swork(struct connection *con)
218218

219219
static void lowcomms_queue_rwork(struct connection *con)
220220
{
221+
#ifdef CONFIG_LOCKDEP
221222
WARN_ON_ONCE(!lockdep_sock_is_held(con->sock->sk));
223+
#endif
222224

223225
if (!test_bit(CF_IO_STOP, &con->flags) &&
224226
!test_and_set_bit(CF_RECV_PENDING, &con->flags))
@@ -618,7 +620,9 @@ static void lowcomms_error_report(struct sock *sk)
618620

619621
static void restore_callbacks(struct sock *sk)
620622
{
623+
#ifdef CONFIG_LOCKDEP
621624
WARN_ON_ONCE(!lockdep_sock_is_held(sk));
625+
#endif
622626

623627
sk->sk_user_data = NULL;
624628
sk->sk_data_ready = listen_sock.sk_data_ready;

0 commit comments

Comments
 (0)