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-3.5-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm

Pull device-mapper discard fixes from Alasdair G Kergon:
- avoid a crash in dm-raid1 when discards coincide with mirror
recovery;
- avoid discarding shared data that's still needed in dm-thin;
- don't guarantee that discarded blocks will be wiped in dm-raid1.

* tag 'dm-3.5-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
dm raid1: set discard_zeroes_data_unsupported
dm thin: do not send discards to shared blocks
dm raid1: fix crash with mirror recovery and discard

+11 -3
+2 -1
drivers/md/dm-raid1.c
··· 1084 1084 ti->split_io = dm_rh_get_region_size(ms->rh); 1085 1085 ti->num_flush_requests = 1; 1086 1086 ti->num_discard_requests = 1; 1087 + ti->discard_zeroes_data_unsupported = 1; 1087 1088 1088 1089 ms->kmirrord_wq = alloc_workqueue("kmirrord", 1089 1090 WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0); ··· 1215 1214 * We need to dec pending if this was a write. 1216 1215 */ 1217 1216 if (rw == WRITE) { 1218 - if (!(bio->bi_rw & REQ_FLUSH)) 1217 + if (!(bio->bi_rw & (REQ_FLUSH | REQ_DISCARD))) 1219 1218 dm_rh_dec(ms->rh, map_context->ll); 1220 1219 return error; 1221 1220 }
+4 -1
drivers/md/dm-region-hash.c
··· 404 404 return; 405 405 } 406 406 407 + if (bio->bi_rw & REQ_DISCARD) 408 + return; 409 + 407 410 /* We must inform the log that the sync count has changed. */ 408 411 log->type->set_region_sync(log, region, 0); 409 412 ··· 527 524 struct bio *bio; 528 525 529 526 for (bio = bios->head; bio; bio = bio->bi_next) { 530 - if (bio->bi_rw & REQ_FLUSH) 527 + if (bio->bi_rw & (REQ_FLUSH | REQ_DISCARD)) 531 528 continue; 532 529 rh_inc(rh, dm_rh_bio_to_region(rh, bio)); 533 530 }
+5 -1
drivers/md/dm-thin.c
··· 1245 1245 1246 1246 cell_release_singleton(cell, bio); 1247 1247 cell_release_singleton(cell2, bio); 1248 - remap_and_issue(tc, bio, lookup_result.block); 1248 + if ((!lookup_result.shared) && pool->pf.discard_passdown) 1249 + remap_and_issue(tc, bio, lookup_result.block); 1250 + else 1251 + bio_endio(bio, 0); 1249 1252 } 1250 1253 break; 1251 1254 ··· 2631 2628 if (tc->pool->pf.discard_enabled) { 2632 2629 ti->discards_supported = 1; 2633 2630 ti->num_discard_requests = 1; 2631 + ti->discard_zeroes_data_unsupported = 1; 2634 2632 } 2635 2633 2636 2634 dm_put(pool_md);