diff options
author | Coly Li <colyli@suse.de> | 2019-06-28 19:59:26 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-26 09:10:39 +0200 |
commit | c067bf154c846fc9eb6f1e1205031bf9615475c4 (patch) | |
tree | acb19f67502b3d3b7613f61193d2bcc4a330c4a2 /drivers/md/bcache | |
parent | 577753b998fae544d6f7683b6243a761a3bf0d11 (diff) | |
download | linux-stable-c067bf154c846fc9eb6f1e1205031bf9615475c4.tar.gz linux-stable-c067bf154c846fc9eb6f1e1205031bf9615475c4.tar.bz2 linux-stable-c067bf154c846fc9eb6f1e1205031bf9615475c4.zip |
bcache: fix return value error in bch_journal_read()
[ Upstream commit 0ae49cb7aa005ed18fe8f4d6ccf73019b78ac7b2 ]
When everything is OK in bch_journal_read(), finally the return value
is returned by,
return ret;
which assumes ret will be 0 here. This assumption is wrong when all
journal buckets as are full and filled with valid journal entries. In
such cache the last location referencess read_bucket() sets 'ret' to
1, which means new jset added into jset list. The jset list is list
'journal' in caller run_cache_set().
Return 1 to run_cache_set() means something wrong and the cache set
won't start, but indeed everything is OK.
This patch changes the line at end of bch_journal_read() to directly
return 0 since everything if verything is good. Then a bogus error
is fixed.
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/md/bcache')
-rw-r--r-- | drivers/md/bcache/journal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index 12dae9348147..4e5fc05720fc 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -268,7 +268,7 @@ bsearch: struct journal_replay, list)->j.seq; - return ret; + return 0; #undef read_bucket } |