Skip to content

Commit

Permalink
bcache: Fix a null ptr deref regression
Browse files Browse the repository at this point in the history
commit 2fe80d3 upstream.

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 <kmo@daterainc.com>
Reported-by: Gabriel de Perthuis <g2p.code@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Kent Overstreet authored and Greg Kroah-Hartman committed Oct 13, 2013
1 parent adf0931 commit 84c8b3b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/md/bcache/request.c
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit 84c8b3b

Please sign in to comment.