Skip to content

Commit

Permalink
seqlock,lockdep: Fix seqcount_latch_init()
Browse files Browse the repository at this point in the history
seqcount_init() must be a macro in order to preserve the static
variable that is used for the lockdep key. Don't then wrap it in an
inline function, which destroys that.

Luckily there aren't many users of this function, but fix it before it
becomes a problem.

Fixes: 80793c3 ("seqlock: Introduce seqcount_latch_t")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/YEeFEbNUVkZaXDp4@hirez.programming.kicks-ass.net
  • Loading branch information
Peter Zijlstra committed Mar 10, 2021
1 parent d5b0e06 commit 4817a52
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/linux/seqlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,7 @@ typedef struct {
* seqcount_latch_init() - runtime initializer for seqcount_latch_t
* @s: Pointer to the seqcount_latch_t instance
*/
static inline void seqcount_latch_init(seqcount_latch_t *s)
{
seqcount_init(&s->seqcount);
}
#define seqcount_latch_init(s) seqcount_init(&(s)->seqcount)

/**
* raw_read_seqcount_latch() - pick even/odd latch data copy
Expand Down

0 comments on commit 4817a52

Please sign in to comment.