projects/linux·commit 2fe80d3b

bcache: Fix a null ptr deref regression

2fe80d3b · Kent Overstreet <[email protected]> · 2013-10-10 17:31:15 -07:00

Commit c0f04d88e46d ("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]>
Commit
2fe80d3bbf1c8bd9efc5b8154207c8dd104e7306
Parents
e3e8ded0

Changes

1 files changed · +1 −2

FileStatusAddDelContent
drivers/md/bcache/request.cmodified+1−2View file

drivers/md/bcache/request.c

View file
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 71eb233..b6a74bc 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -996,6 +996,7 @@ static void request_write(struct cached_dev *dc, struct search *s)
closure_bio_submit(bio, cl, s->d);
} else {
bch_writeback_add(dc);
+ s->op.cache_bio = bio;
if (bio->bi_rw & REQ_FLUSH) {
/* 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;
closure_bio_submit(flush, cl, s->d);
- } else {
- s->op.cache_bio = bio;
}
}
out: