diff options
author | Ryan Moeller <[email protected]> | 2021-03-29 15:44:27 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-04-01 08:43:01 -0700 |
commit | 3ba10f9a6ae3c1b339fb7ff78a6bc9c314e3e08c (patch) | |
tree | 4c5916ac0f07cd881079b8a1678fa50e9b870146 /module | |
parent | 9f9e1b5425ffa3e248504e401828eb13a3f1d00e (diff) |
Atomically check and set dropped zevent count
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #11822
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/fm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/module/zfs/fm.c b/module/zfs/fm.c index 3070cab1e..c79d291ab 100644 --- a/module/zfs/fm.c +++ b/module/zfs/fm.c @@ -657,8 +657,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: |