mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
bcache: Fix a null ptr deref regression
Commit c0f04d88e4
("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: Kent Overstreet <kmo@daterainc.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v3.10
Reported-by: Gabriel de Perthuis <g2p.code@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e3e8ded06f
commit
2fe80d3bbf
1 changed files with 1 additions and 2 deletions
|
@ -996,6 +996,7 @@ static void request_write(struct cached_dev *dc, struct search *s)
|
||||||
closure_bio_submit(bio, cl, s->d);
|
closure_bio_submit(bio, cl, s->d);
|
||||||
} else {
|
} else {
|
||||||
bch_writeback_add(dc);
|
bch_writeback_add(dc);
|
||||||
|
s->op.cache_bio = bio;
|
||||||
|
|
||||||
if (bio->bi_rw & REQ_FLUSH) {
|
if (bio->bi_rw & REQ_FLUSH) {
|
||||||
/* Also need to send a flush to the backing device */
|
/* Also need to send a flush to the backing device */
|
||||||
|
@ -1008,8 +1009,6 @@ static void request_write(struct cached_dev *dc, struct search *s)
|
||||||
flush->bi_private = cl;
|
flush->bi_private = cl;
|
||||||
|
|
||||||
closure_bio_submit(flush, cl, s->d);
|
closure_bio_submit(flush, cl, s->d);
|
||||||
} else {
|
|
||||||
s->op.cache_bio = bio;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue