Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'dm-4.8-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device mapper fixes from Mike Snitzer:

- another stable fix for DM flakey (that tweaks the previous fix that
didn't factor in expected 'drop_writes' behavior for read IO).

- a dm-log bio operation flags fix for the broader block changes that
were merged during the 4.8 merge window.

* tag 'dm-4.8-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm log: fix unitialized bio operation flags
dm flakey: fix reads to be issued if drop_writes configured

+22 -16
+16 -11
drivers/md/dm-flakey.c
··· 289 289 pb->bio_submitted = true; 290 290 291 291 /* 292 - * Map reads as normal only if corrupt_bio_byte set. 292 + * Error reads if neither corrupt_bio_byte or drop_writes are set. 293 + * Otherwise, flakey_end_io() will decide if the reads should be modified. 293 294 */ 294 295 if (bio_data_dir(bio) == READ) { 295 - /* If flags were specified, only corrupt those that match. */ 296 - if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) && 297 - all_corrupt_bio_flags_match(bio, fc)) 298 - goto map_bio; 299 - else 296 + if (!fc->corrupt_bio_byte && !test_bit(DROP_WRITES, &fc->flags)) 300 297 return -EIO; 298 + goto map_bio; 301 299 } 302 300 303 301 /* ··· 332 334 struct flakey_c *fc = ti->private; 333 335 struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data)); 334 336 335 - /* 336 - * Corrupt successful READs while in down state. 337 - */ 338 337 if (!error && pb->bio_submitted && (bio_data_dir(bio) == READ)) { 339 - if (fc->corrupt_bio_byte) 338 + if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) && 339 + all_corrupt_bio_flags_match(bio, fc)) { 340 + /* 341 + * Corrupt successful matching READs while in down state. 342 + */ 340 343 corrupt_bio_data(bio, fc); 341 - else 344 + 345 + } else if (!test_bit(DROP_WRITES, &fc->flags)) { 346 + /* 347 + * Error read during the down_interval if drop_writes 348 + * wasn't configured. 349 + */ 342 350 return -EIO; 351 + } 343 352 } 344 353 345 354 return error;
+6 -5
drivers/md/dm-log.c
··· 291 291 core->nr_regions = le64_to_cpu(disk->nr_regions); 292 292 } 293 293 294 - static int rw_header(struct log_c *lc, int rw) 294 + static int rw_header(struct log_c *lc, int op) 295 295 { 296 - lc->io_req.bi_op = rw; 296 + lc->io_req.bi_op = op; 297 + lc->io_req.bi_op_flags = 0; 297 298 298 299 return dm_io(&lc->io_req, 1, &lc->header_location, NULL); 299 300 } ··· 317 316 { 318 317 int r; 319 318 320 - r = rw_header(log, READ); 319 + r = rw_header(log, REQ_OP_READ); 321 320 if (r) 322 321 return r; 323 322 ··· 631 630 header_to_disk(&lc->header, lc->disk_header); 632 631 633 632 /* write the new header */ 634 - r = rw_header(lc, WRITE); 633 + r = rw_header(lc, REQ_OP_WRITE); 635 634 if (!r) { 636 635 r = flush_header(lc); 637 636 if (r) ··· 699 698 log_clear_bit(lc, lc->clean_bits, i); 700 699 } 701 700 702 - r = rw_header(lc, WRITE); 701 + r = rw_header(lc, REQ_OP_WRITE); 703 702 if (r) 704 703 fail_log_device(lc); 705 704 else {