dm-flakey.c (4f2c0a4acffbec01079c28f839422e64ddeff004) | dm-flakey.c (f50714b57aecb6b3dc81d578e295f86d9c73f078) |
---|---|
1/* 2 * Copyright (C) 2003 Sistina Software (UK) Limited. 3 * Copyright (C) 2004, 2010-2011 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include <linux/device-mapper.h> --- 289 unchanged lines hidden (view full) --- 298 return; 299 300 /* 301 * Overwrite the Nth byte of the bio's data, on whichever page 302 * it falls. 303 */ 304 bio_for_each_segment(bvec, bio, iter) { 305 if (bio_iter_len(bio, iter) > corrupt_bio_byte) { | 1/* 2 * Copyright (C) 2003 Sistina Software (UK) Limited. 3 * Copyright (C) 2004, 2010-2011 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include <linux/device-mapper.h> --- 289 unchanged lines hidden (view full) --- 298 return; 299 300 /* 301 * Overwrite the Nth byte of the bio's data, on whichever page 302 * it falls. 303 */ 304 bio_for_each_segment(bvec, bio, iter) { 305 if (bio_iter_len(bio, iter) > corrupt_bio_byte) { |
306 char *segment = (page_address(bio_iter_page(bio, iter)) 307 + bio_iter_offset(bio, iter)); | 306 char *segment; 307 struct page *page = bio_iter_page(bio, iter); 308 if (unlikely(page == ZERO_PAGE(0))) 309 break; 310 segment = (page_address(page) + bio_iter_offset(bio, iter)); |
308 segment[corrupt_bio_byte] = fc->corrupt_bio_value; 309 DMDEBUG("Corrupting data bio=%p by writing %u to byte %u " 310 "(rw=%c bi_opf=%u bi_sector=%llu size=%u)\n", 311 bio, fc->corrupt_bio_value, fc->corrupt_bio_byte, 312 (bio_data_dir(bio) == WRITE) ? 'w' : 'r', bio->bi_opf, 313 (unsigned long long)bio->bi_iter.bi_sector, bio->bi_iter.bi_size); 314 break; 315 } --- 208 unchanged lines hidden --- | 311 segment[corrupt_bio_byte] = fc->corrupt_bio_value; 312 DMDEBUG("Corrupting data bio=%p by writing %u to byte %u " 313 "(rw=%c bi_opf=%u bi_sector=%llu size=%u)\n", 314 bio, fc->corrupt_bio_value, fc->corrupt_bio_byte, 315 (bio_data_dir(bio) == WRITE) ? 'w' : 'r', bio->bi_opf, 316 (unsigned long long)bio->bi_iter.bi_sector, bio->bi_iter.bi_size); 317 break; 318 } --- 208 unchanged lines hidden --- |