From 5ceaaad7047745c1c02150c39d3fb623b7948d48 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 10 Sep 2013 14:27:42 -0700 Subject: bcache: Bypass torture test More testing ftw! Also, now verify mode doesn't break if you read dirty data. Signed-off-by: Kent Overstreet --- drivers/md/bcache/debug.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'drivers/md/bcache/debug.c') diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index e99e6b8852b2..264fcfbd6290 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -189,13 +189,14 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) void *p1 = kmap_atomic(bv->bv_page); void *p2 = page_address(check->bi_io_vec[i].bv_page); - if (memcmp(p1 + bv->bv_offset, - p2 + bv->bv_offset, - bv->bv_len)) - printk(KERN_ERR - "bcache (%s): verify failed at sector %llu\n", - bdevname(dc->bdev, name), - (uint64_t) bio->bi_sector); + cache_set_err_on(memcmp(p1 + bv->bv_offset, + p2 + bv->bv_offset, + bv->bv_len), + dc->disk.c, + "verify failed at dev %s sector %llu", + bdevname(dc->bdev, name), + (uint64_t) bio->bi_sector); + kunmap_atomic(p1); } -- cgit v1.2.3