Skip to content
Commit ff73c2c0 authored by Eric Biggers's avatar Eric Biggers
Browse files

fscrypt: avoid data race on fscrypt_mode::logged_impl_name

The access to logged_impl_name is technically a data race, which tools
like KCSAN could complain about in the future.  See:
https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE



Fix by using xchg(), which also ensures that only one thread does the
logging.

This also required switching from bool to int, to avoid a build error on
the RISC-V architecture which doesn't implement xchg on bytes.

Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
parent 065ab4c4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment