diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-10-10 20:31:15 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-13 19:08:35 -0400 |
commit | 84c8b3b9e17107a74f07dc5e48264034f1410b97 (patch) | |
tree | 92714f1610b72010aa6d0771a70ec3feb5342506 | |
parent | adf0931b2b3ce91cc4096939650f4c4a3f68fef5 (diff) |
bcache: Fix a null ptr deref regression
commit 2fe80d3bbf1c8bd9efc5b8154207c8dd104e7306 upstream.
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>
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>
-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 2fe37fac1ca2..cbcf8b301edc 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
@@ -1055,6 +1055,7 @@ static void request_write(struct cached_dev *dc, struct search *s) | |||
1055 | } else { | 1055 | } else { |
1056 | trace_bcache_writeback(s->orig_bio); | 1056 | trace_bcache_writeback(s->orig_bio); |
1057 | bch_writeback_add(dc, bio_sectors(bio)); | 1057 | bch_writeback_add(dc, bio_sectors(bio)); |
1058 | s->op.cache_bio = bio; | ||
1058 | 1059 | ||
1059 | if (bio->bi_rw & REQ_FLUSH) { | 1060 | if (bio->bi_rw & REQ_FLUSH) { |
1060 | /* Also need to send a flush to the backing device */ | 1061 | /* 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) | |||
1067 | flush->bi_private = cl; | 1068 | flush->bi_private = cl; |
1068 | 1069 | ||
1069 | closure_bio_submit(flush, cl, s->d); | 1070 | closure_bio_submit(flush, cl, s->d); |
1070 | } else { | ||
1071 | s->op.cache_bio = bio; | ||
1072 | } | 1071 | } |
1073 | } | 1072 | } |
1074 | out: | 1073 | out: |