diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-10-10 20:31:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-10 21:17:39 -0400 |
commit | 2fe80d3bbf1c8bd9efc5b8154207c8dd104e7306 (patch) | |
tree | 729b2f1de3b8bf8eb96e1640c415b8d0c3b5fe1c | |
parent | e3e8ded06f0960d642a81dd676fff0367af68ba0 (diff) |
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.
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>
-rw-r--r-- | drivers/md/bcache/request.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 71eb233b9ace..b6a74bcbb08f 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) | |||
996 | closure_bio_submit(bio, cl, s->d); | 996 | closure_bio_submit(bio, cl, s->d); |
997 | } else { | 997 | } else { |
998 | bch_writeback_add(dc); | 998 | bch_writeback_add(dc); |
999 | s->op.cache_bio = bio; | ||
999 | 1000 | ||
1000 | if (bio->bi_rw & REQ_FLUSH) { | 1001 | if (bio->bi_rw & REQ_FLUSH) { |
1001 | /* Also need to send a flush to the backing device */ | 1002 | /* 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) | |||
1008 | flush->bi_private = cl; | 1009 | flush->bi_private = cl; |
1009 | 1010 | ||
1010 | closure_bio_submit(flush, cl, s->d); | 1011 | closure_bio_submit(flush, cl, s->d); |
1011 | } else { | ||
1012 | s->op.cache_bio = bio; | ||
1013 | } | 1012 | } |
1014 | } | 1013 | } |
1015 | out: | 1014 | out: |