diff options
author | winglq <[email protected]> | 2020-07-07 02:46:17 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-06 11:46:17 -0700 |
commit | a4b0a74c7f346cab0a9ae3f8f55bd1a372e14336 (patch) | |
tree | cf5d62cf01a73d4eb114452cc415db27a551fc7a | |
parent | 8a3d9186ba0c99834506392428c5c6cc3a0954a9 (diff) |
Fix atomic_clear_long_excl wrong return
When clearing a bit, we should check whether that bit is 0.
Note atomic_clear_long_excl is not used.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Liu Qing <[email protected]>
Closes #10526
-rw-r--r-- | lib/libspl/asm-generic/atomic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libspl/asm-generic/atomic.c b/lib/libspl/asm-generic/atomic.c index f03f93609..35535ea49 100644 --- a/lib/libspl/asm-generic/atomic.c +++ b/lib/libspl/asm-generic/atomic.c @@ -415,7 +415,7 @@ atomic_clear_long_excl(volatile ulong_t *target, uint_t value) VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0); bit = (1UL << value); - if ((*target & bit) != 0) { + if ((*target & bit) == 0) { VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0); return (-1); } |