Skip to content

Commit

Permalink
Atomically check and set dropped zevent count
Browse files Browse the repository at this point in the history
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
  • Loading branch information
Ryan Moeller committed May 6, 2021
1 parent 3edbb09 commit 2ca4c2e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions module/zfs/fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,7 @@ zfs_zevent_next(zfs_zevent_t *ze, nvlist_t **event, uint64_t *event_size,

#ifdef _KERNEL
/* Include events dropped due to rate limiting */
*dropped += ratelimit_dropped;
ratelimit_dropped = 0;
*dropped += atomic_swap_64(&ratelimit_dropped, 0);
#endif
ze->ze_dropped = 0;
out:
Expand Down

0 comments on commit 2ca4c2e

Please sign in to comment.