diff options
author | 2022-08-10 16:16:34 -0400 | |
---|---|---|
committer | 2022-08-11 11:10:42 -0400 | |
commit | e3a7c2947b9e01b9cedd3f67849c0ae95f0fadfa (patch) | |
tree | c7710728a55e2a9b042beda3c95b6ab28cd609b8 /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | dm writecache: fix smatch warning about invalid return from writecache_map (diff) | |
download | wireguard-linux-e3a7c2947b9e01b9cedd3f67849c0ae95f0fadfa.tar.xz wireguard-linux-e3a7c2947b9e01b9cedd3f67849c0ae95f0fadfa.zip |
dm bufio: fix some cases where the code sleeps with spinlock held
Commit b32d45824aa7 ("dm bufio: Add DM_BUFIO_CLIENT_NO_SLEEP flag")
added a "NO_SLEEP" mode, it replaces a mutex with a spinlock, and it
is only usable when the device is in read-only mode (because the write
path may be sleeping while holding the dm_bufio_client lock).
However, there are still two points where the code could sleep even in
read-only mode. One is in __get_unclaimed_buffer -> __make_buffer_clean.
The other is in __try_evict_buffer -> __make_buffer_clean. These functions
will call __make_buffer_clean which sleeps if the buffer is being read.
Fix these cases so that if c->no_sleep is set __make_buffer_clean
will not be called and the buffer will be skipped instead.
Fixes: b32d45824aa7 ("dm bufio: Add DM_BUFIO_CLIENT_NO_SLEEP flag")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions