History

bcache: Fix a null ptr deref regression

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.

Kent Overstreet committed 13 years ago

Commit 2fe80d31 parent e3e8ded1 file · +1 −2Browse files

Unified · Split

drivers/md/bcache/request.c+1−2
@@ -996,6 +996,7 @@ static void request_write(struct cached_dev *dc, struct search *s) · 995 unmodified lines
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) · 6 unmodified lines
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:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t