History

signal: Use lockdep_assert_held instead of assert_spin_locked

The distinction is that assert_spin_locked() checks if the lock is held *by*anyone* whereas lockdep_assert_held() asserts the current context holds the lock. Also, the check goes away if you build without lockdep.

Eric W. Biederman committed 4 years ago

Commit cb3c19c1 parent 16cc1bc1 file · +2 −2Browse files

Unified · Split

kernel/signal.c+2−2
@@ -884,7 +884,7 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info, · 883 unmodified lines
884884 static void ptrace_trap_notify(struct task_struct *t)
885885 {
886886 WARN_ON_ONCE(!(t->ptrace & PT_SEIZED));
887− assert_spin_locked(&t->sighand->siglock);
887+ lockdep_assert_held(&t->sighand->siglock);
888888
889889 task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY);
890890 ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
@@ -1079,7 +1079,7 @@ static int __send_signal_locked(int sig, struct kernel_siginfo *info, · 188 unmodified lines
10791079 int override_rlimit;
10801080 int ret = 0, result;
10811081
1082− assert_spin_locked(&t->sighand->siglock);
1082+ lockdep_assert_held(&t->sighand->siglock);
10831083
10841084 result = TRACE_SIGNAL_IGNORED;
10851085 if (!prepare_signal(sig, t, force))