Commit 84c8b3b9 authored by Kent Overstreet's avatar Kent Overstreet Committed by Greg Kroah-Hartman

bcache: Fix a null ptr deref regression

commit 2fe80d3b upstream.

Commit c0f04d88 ("bcache: Fix flushes in writeback mode") was fixing
a reported data corruption bug, but it seems some last minute
refactoring or rebasing introduced a null pointer deref.
Signed-off-by: default avatarKent Overstreet <kmo@daterainc.com>
Reported-by: default avatarGabriel de Perthuis <g2p.code@gmail.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent adf0931b
......@@ -1055,6 +1055,7 @@ static void request_write(struct cached_dev *dc, struct search *s)
} else {
trace_bcache_writeback(s->orig_bio);
bch_writeback_add(dc, bio_sectors(bio));
s->op.cache_bio = bio;
if (bio->bi_rw & REQ_FLUSH) {
/* Also need to send a flush to the backing device */
......@@ -1067,8 +1068,6 @@ static void request_write(struct cached_dev *dc, struct search *s)
flush->bi_private = cl;
closure_bio_submit(flush, cl, s->d);
} else {
s->op.cache_bio = bio;
}
}
out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment