diff options
author | Coly Li <colyli@suse.de> | 2019-04-25 00:48:36 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-04-24 10:56:28 -0600 |
commit | 68d10e6979a3b59e3cd2e90bfcafed79c4cf180a (patch) | |
tree | b3c9efdfafa93d2582f4d2e89b7825d8c878b6c9 /drivers/md/bcache/super.c | |
parent | 2d17456eb1cc78803b999fdd503c2dbd42a7d3da (diff) | |
download | lwn-68d10e6979a3b59e3cd2e90bfcafed79c4cf180a.tar.gz lwn-68d10e6979a3b59e3cd2e90bfcafed79c4cf180a.zip |
bcache: return error immediately in bch_journal_replay()
When failure happens inside bch_journal_replay(), calling
cache_set_err_on() and handling the failure in async way is not a good
idea. Because after bch_journal_replay() returns, registering code will
continue to execute following steps, and unregistering code triggered
by cache_set_err_on() is running in same time. First it is unnecessary
to handle failure and unregister cache set in an async way, second there
might be potential race condition to run register and unregister code
for same cache set.
So in this patch, if failure happens in bch_journal_replay(), we don't
call cache_set_err_on(), and just print out the same error message to
kernel message buffer, then return -EIO immediately caller. Then caller
can detect such failure and handle it in synchrnozied way.
Signed-off-by: Coly Li <colyli@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/super.c')
0 files changed, 0 insertions, 0 deletions