diff options
author | Coly Li | 2019-04-25 00:48:34 +0800 |
---|---|---|
committer | Jens Axboe | 2019-04-24 10:56:28 -0600 |
commit | ce3e4cfb59cb382f8e5ce359238aa580d4ae7778 (patch) | |
tree | c122d0812e00ab2a9a1ede1ba93caa3badfd2204 /mm/kasan | |
parent | 1bee2addc0c8470c8aaa65ef0599eeae96dd88bc (diff) |
bcache: add failure check to run_cache_set() for journal replay
Currently run_cache_set() has no return value, if there is failure in
bch_journal_replay(), the caller of run_cache_set() has no idea about
such failure and just continue to execute following code after
run_cache_set(). The internal failure is triggered inside
bch_journal_replay() and being handled in async way. This behavior is
inefficient, while failure handling inside bch_journal_replay(), cache
register code is still running to start the cache set. Registering and
unregistering code running as same time may introduce some rare race
condition, and make the code to be more hard to be understood.
This patch adds return value to run_cache_set(), and returns -EIO if
bch_journal_rreplay() fails. Then caller of run_cache_set() may detect
such failure and stop registering code flow immedidately inside
register_cache_set().
If journal replay fails, run_cache_set() can report error immediately
to register_cache_set(). This patch makes the failure handling for
bch_journal_replay() be in synchronized way, easier to understand and
debug, and avoid poetential race condition for register-and-unregister
in same time.
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'mm/kasan')
0 files changed, 0 insertions, 0 deletions