Skip to content

Commit 2fe80d3

Browse files
Kent Overstreettorvalds
authored andcommitted
bcache: Fix a null ptr deref regression
Commit c0f04d8 ("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 <[email protected]> Cc: linux-stable <[email protected]> # >= v3.10 Reported-by: Gabriel de Perthuis <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e3e8ded commit 2fe80d3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/md/bcache/request.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@ static void request_write(struct cached_dev *dc, struct search *s)
996996
closure_bio_submit(bio, cl, s->d);
997997
} else {
998998
bch_writeback_add(dc);
999+
s->op.cache_bio = bio;
9991000

10001001
if (bio->bi_rw & REQ_FLUSH) {
10011002
/* 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)
10081009
flush->bi_private = cl;
10091010

10101011
closure_bio_submit(flush, cl, s->d);
1011-
} else {
1012-
s->op.cache_bio = bio;
10131012
}
10141013
}
10151014
out:

0 commit comments

Comments
 (0)