hsr: annotate data-race around hsr->sequence_nr

hsr->sequence_nr is incremented from the transmit paths under
hsr->seqnr_lock, but hsr_fill_info() reads it without holding
this lock.

Use WRITE_ONCE() in the two writers, so that a matching
READ_ONCE() can be used in hsr_fill_info().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260916132822.1791040-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Eric Dumazet 2026-09-16 13:28:21 +00:00 committed by Jakub Kicinski
parent 4090fcee93
commit 41c57cf050
2 changed files with 2 additions and 2 deletions

View File

@ -333,7 +333,7 @@ static void send_hsr_supervision_frame(struct hsr_port *port,
hsr->sup_sequence_nr++;
} else {
hsr_stag->sequence_nr = htons(hsr->sequence_nr);
hsr->sequence_nr++;
WRITE_ONCE(hsr->sequence_nr, hsr->sequence_nr + 1);
}
hsr_stag->tlv.HSR_TLV_type = type;

View File

@ -645,7 +645,7 @@ static void handle_std_frame(struct sk_buff *skb,
/* Sequence nr for the master/interlink node */
lockdep_assert_held(&hsr->seqnr_lock);
frame->sequence_nr = hsr->sequence_nr;
hsr->sequence_nr++;
WRITE_ONCE(hsr->sequence_nr, hsr->sequence_nr + 1);
}
}