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

Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md

Pull MD updates from Shaohua Li:
"Some small fixes for MD:

- fix raid5-cache potential problems if raid5 cache isn't fully
recovered

- fix a wait-within-wait warning in raid1/10

- make raid5-PPL support disks with writeback cache enabled"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
raid5-ppl: PPL support for disks with write-back cache enabled
md/r5cache: print more info of log recovery
md/raid1,raid10: silence warning about wait-within-wait
md: introduce new personality funciton start()

+285 -38
+4 -3
Documentation/md/raid5-ppl.txt
··· 39 39 PPL is available for md version-1 metadata and external (specifically IMSM) 40 40 metadata arrays. It can be enabled using mdadm option --consistency-policy=ppl. 41 41 42 - Currently, volatile write-back cache should be disabled on all member drives 43 - when using PPL. Otherwise it cannot guarantee consistency in case of power 44 - failure. 42 + There is a limitation of maximum 64 disks in the array for PPL. It allows to 43 + keep data structures and implementation simple. RAID5 arrays with so many disks 44 + are not likely due to high risk of multiple disks failure. Such restriction 45 + should not be a real life limitation.
+9
drivers/md/dm-raid.c
··· 3151 3151 goto bad; 3152 3152 } 3153 3153 3154 + r = md_start(&rs->md); 3155 + 3156 + if (r) { 3157 + ti->error = "Failed to start raid array"; 3158 + mddev_unlock(&rs->md); 3159 + goto bad_md_start; 3160 + } 3161 + 3154 3162 rs->callbacks.congested_fn = raid_is_congested; 3155 3163 dm_table_add_target_callbacks(ti->table, &rs->callbacks); 3156 3164 ··· 3206 3198 mddev_unlock(&rs->md); 3207 3199 return 0; 3208 3200 3201 + bad_md_start: 3209 3202 bad_journal_mode_set: 3210 3203 bad_stripe_cache: 3211 3204 bad_check_reshape:
+23 -8
drivers/md/md.c
··· 711 711 return NULL; 712 712 } 713 713 714 - static struct md_rdev *find_rdev_rcu(struct mddev *mddev, dev_t dev) 714 + struct md_rdev *md_find_rdev_rcu(struct mddev *mddev, dev_t dev) 715 715 { 716 716 struct md_rdev *rdev; 717 717 ··· 721 721 722 722 return NULL; 723 723 } 724 + EXPORT_SYMBOL_GPL(md_find_rdev_rcu); 724 725 725 726 static struct md_personality *find_pers(int level, char *clevel) 726 727 { ··· 5561 5560 if (start_readonly && mddev->ro == 0) 5562 5561 mddev->ro = 2; /* read-only, but switch on first write */ 5563 5562 5564 - /* 5565 - * NOTE: some pers->run(), for example r5l_recovery_log(), wakes 5566 - * up mddev->thread. It is important to initialize critical 5567 - * resources for mddev->thread BEFORE calling pers->run(). 5568 - */ 5569 5563 err = pers->run(mddev); 5570 5564 if (err) 5571 5565 pr_warn("md: pers->run() failed ...\n"); ··· 5674 5678 if (mddev_is_clustered(mddev)) 5675 5679 md_allow_write(mddev); 5676 5680 5681 + /* run start up tasks that require md_thread */ 5682 + md_start(mddev); 5683 + 5677 5684 md_wakeup_thread(mddev->thread); 5678 5685 md_wakeup_thread(mddev->sync_thread); /* possibly kick off a reshape */ 5679 5686 ··· 5687 5688 out: 5688 5689 return err; 5689 5690 } 5691 + 5692 + int md_start(struct mddev *mddev) 5693 + { 5694 + int ret = 0; 5695 + 5696 + if (mddev->pers->start) { 5697 + set_bit(MD_RECOVERY_WAIT, &mddev->recovery); 5698 + md_wakeup_thread(mddev->thread); 5699 + ret = mddev->pers->start(mddev); 5700 + clear_bit(MD_RECOVERY_WAIT, &mddev->recovery); 5701 + md_wakeup_thread(mddev->sync_thread); 5702 + } 5703 + return ret; 5704 + } 5705 + EXPORT_SYMBOL_GPL(md_start); 5690 5706 5691 5707 static int restart_array(struct mddev *mddev) 5692 5708 { ··· 7011 6997 return -ENODEV; 7012 6998 7013 6999 rcu_read_lock(); 7014 - rdev = find_rdev_rcu(mddev, dev); 7000 + rdev = md_find_rdev_rcu(mddev, dev); 7015 7001 if (!rdev) 7016 7002 err = -ENODEV; 7017 7003 else { ··· 8183 8169 int ret; 8184 8170 8185 8171 /* just incase thread restarts... */ 8186 - if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) 8172 + if (test_bit(MD_RECOVERY_DONE, &mddev->recovery) || 8173 + test_bit(MD_RECOVERY_WAIT, &mddev->recovery)) 8187 8174 return; 8188 8175 if (mddev->ro) {/* never try to sync a read-only array */ 8189 8176 set_bit(MD_RECOVERY_INTR, &mddev->recovery);
+9
drivers/md/md.h
··· 485 485 MD_RECOVERY_RESHAPE, /* A reshape is happening */ 486 486 MD_RECOVERY_FROZEN, /* User request to abort, and not restart, any action */ 487 487 MD_RECOVERY_ERROR, /* sync-action interrupted because io-error */ 488 + MD_RECOVERY_WAIT, /* waiting for pers->start() to finish */ 488 489 }; 489 490 490 491 static inline int __must_check mddev_lock(struct mddev *mddev) ··· 524 523 struct list_head list; 525 524 struct module *owner; 526 525 bool (*make_request)(struct mddev *mddev, struct bio *bio); 526 + /* 527 + * start up works that do NOT require md_thread. tasks that 528 + * requires md_thread should go into start() 529 + */ 527 530 int (*run)(struct mddev *mddev); 531 + /* start up works that require md threads */ 532 + int (*start)(struct mddev *mddev); 528 533 void (*free)(struct mddev *mddev, void *priv); 529 534 void (*status)(struct seq_file *seq, struct mddev *mddev); 530 535 /* error_handler must set ->faulty and clear ->in_sync ··· 694 687 695 688 extern void mddev_init(struct mddev *mddev); 696 689 extern int md_run(struct mddev *mddev); 690 + extern int md_start(struct mddev *mddev); 697 691 extern void md_stop(struct mddev *mddev); 698 692 extern void md_stop_writes(struct mddev *mddev); 699 693 extern int md_rdev_init(struct md_rdev *rdev); ··· 710 702 extern void md_update_sb(struct mddev *mddev, int force); 711 703 extern void md_kick_rdev_from_array(struct md_rdev * rdev); 712 704 struct md_rdev *md_find_rdev_nr_rcu(struct mddev *mddev, int nr); 705 + struct md_rdev *md_find_rdev_rcu(struct mddev *mddev, dev_t dev); 713 706 714 707 static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) 715 708 {
+11
drivers/md/raid1.c
··· 815 815 bio = bio_list_get(&conf->pending_bio_list); 816 816 conf->pending_count = 0; 817 817 spin_unlock_irq(&conf->device_lock); 818 + 819 + /* 820 + * As this is called in a wait_event() loop (see freeze_array), 821 + * current->state might be TASK_UNINTERRUPTIBLE which will 822 + * cause a warning when we prepare to wait again. As it is 823 + * rare that this path is taken, it is perfectly safe to force 824 + * us to go around the wait_event() loop again, so the warning 825 + * is a false-positive. Silence the warning by resetting 826 + * thread state 827 + */ 828 + __set_current_state(TASK_RUNNING); 818 829 blk_start_plug(&plug); 819 830 flush_bio_list(conf, bio); 820 831 blk_finish_plug(&plug);
+12
drivers/md/raid10.c
··· 900 900 bio = bio_list_get(&conf->pending_bio_list); 901 901 conf->pending_count = 0; 902 902 spin_unlock_irq(&conf->device_lock); 903 + 904 + /* 905 + * As this is called in a wait_event() loop (see freeze_array), 906 + * current->state might be TASK_UNINTERRUPTIBLE which will 907 + * cause a warning when we prepare to wait again. As it is 908 + * rare that this path is taken, it is perfectly safe to force 909 + * us to go around the wait_event() loop again, so the warning 910 + * is a false-positive. Silence the warning by resetting 911 + * thread state 912 + */ 913 + __set_current_state(TASK_RUNNING); 914 + 903 915 blk_start_plug(&plug); 904 916 /* flush any pending bitmap writes to disk 905 917 * before proceeding w/ I/O */
+19 -12
drivers/md/raid5-cache.c
··· 1111 1111 1112 1112 int r5l_handle_flush_request(struct r5l_log *log, struct bio *bio) 1113 1113 { 1114 - if (!log) 1115 - return -ENODEV; 1116 - 1117 1114 if (log->r5c_journal_mode == R5C_JOURNAL_MODE_WRITE_THROUGH) { 1118 1115 /* 1119 1116 * in write through (journal only) ··· 1589 1592 void r5l_quiesce(struct r5l_log *log, int quiesce) 1590 1593 { 1591 1594 struct mddev *mddev; 1592 - if (!log) 1593 - return; 1594 1595 1595 1596 if (quiesce) { 1596 1597 /* make sure r5l_write_super_and_discard_space exits */ ··· 2443 2448 raid5_release_stripe(sh); 2444 2449 } 2445 2450 2446 - md_wakeup_thread(conf->mddev->thread); 2447 2451 /* reuse conf->wait_for_quiescent in recovery */ 2448 2452 wait_event(conf->wait_for_quiescent, 2449 2453 atomic_read(&conf->active_stripes) == 0); ··· 2485 2491 ctx->seq += 10000; 2486 2492 2487 2493 if ((ctx->data_only_stripes == 0) && (ctx->data_parity_stripes == 0)) 2488 - pr_debug("md/raid:%s: starting from clean shutdown\n", 2494 + pr_info("md/raid:%s: starting from clean shutdown\n", 2489 2495 mdname(mddev)); 2490 2496 else 2491 - pr_debug("md/raid:%s: recovering %d data-only stripes and %d data-parity stripes\n", 2497 + pr_info("md/raid:%s: recovering %d data-only stripes and %d data-parity stripes\n", 2492 2498 mdname(mddev), ctx->data_only_stripes, 2493 2499 ctx->data_parity_stripes); 2494 2500 ··· 3030 3036 return ret; 3031 3037 } 3032 3038 3039 + int r5l_start(struct r5l_log *log) 3040 + { 3041 + int ret; 3042 + 3043 + if (!log) 3044 + return 0; 3045 + 3046 + ret = r5l_load_log(log); 3047 + if (ret) { 3048 + struct mddev *mddev = log->rdev->mddev; 3049 + struct r5conf *conf = mddev->private; 3050 + 3051 + r5l_exit_log(conf); 3052 + } 3053 + return ret; 3054 + } 3055 + 3033 3056 void r5c_update_on_rdev_error(struct mddev *mddev, struct md_rdev *rdev) 3034 3057 { 3035 3058 struct r5conf *conf = mddev->private; ··· 3149 3138 3150 3139 rcu_assign_pointer(conf->log, log); 3151 3140 3152 - if (r5l_load_log(log)) 3153 - goto error; 3154 - 3155 3141 set_bit(MD_HAS_JOURNAL, &conf->mddev->flags); 3156 3142 return 0; 3157 3143 3158 - error: 3159 3144 rcu_assign_pointer(conf->log, NULL); 3160 3145 md_unregister_thread(&log->reclaim_thread); 3161 3146 reclaim_thread:
+30
drivers/md/raid5-log.h
··· 32 32 extern void r5c_update_on_rdev_error(struct mddev *mddev, 33 33 struct md_rdev *rdev); 34 34 extern bool r5c_big_stripe_cached(struct r5conf *conf, sector_t sect); 35 + extern int r5l_start(struct r5l_log *log); 35 36 36 37 extern struct dma_async_tx_descriptor * 37 38 ops_run_partial_parity(struct stripe_head *sh, struct raid5_percpu *percpu, ··· 43 42 extern void ppl_write_stripe_run(struct r5conf *conf); 44 43 extern void ppl_stripe_write_finished(struct stripe_head *sh); 45 44 extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add); 45 + extern void ppl_quiesce(struct r5conf *conf, int quiesce); 46 46 47 47 static inline bool raid5_has_ppl(struct r5conf *conf) 48 48 { ··· 87 85 r5l_write_stripe_run(conf->log); 88 86 else if (raid5_has_ppl(conf)) 89 87 ppl_write_stripe_run(conf); 88 + } 89 + 90 + static inline void log_flush_stripe_to_raid(struct r5conf *conf) 91 + { 92 + if (conf->log) 93 + r5l_flush_stripe_to_raid(conf->log); 94 + else if (raid5_has_ppl(conf)) 95 + ppl_write_stripe_run(conf); 96 + } 97 + 98 + static inline int log_handle_flush_request(struct r5conf *conf, struct bio *bio) 99 + { 100 + int ret = -ENODEV; 101 + 102 + if (conf->log) 103 + ret = r5l_handle_flush_request(conf->log, bio); 104 + else if (raid5_has_ppl(conf)) 105 + ret = 0; 106 + 107 + return ret; 108 + } 109 + 110 + static inline void log_quiesce(struct r5conf *conf, int quiesce) 111 + { 112 + if (conf->log) 113 + r5l_quiesce(conf->log, quiesce); 114 + else if (raid5_has_ppl(conf)) 115 + ppl_quiesce(conf, quiesce); 90 116 } 91 117 92 118 static inline void log_exit(struct r5conf *conf)
+155 -12
drivers/md/raid5-ppl.c
··· 85 85 * (for a single member disk). New io_units are added to the end of the list 86 86 * and the first io_unit is submitted, if it is not submitted already. 87 87 * The current io_unit accepting new stripes is always at the end of the list. 88 + * 89 + * If write-back cache is enabled for any of the disks in the array, its data 90 + * must be flushed before next io_unit is submitted. 88 91 */ 89 92 90 93 #define PPL_SPACE_SIZE (128 * 1024) ··· 107 104 struct kmem_cache *io_kc; 108 105 mempool_t *io_pool; 109 106 struct bio_set *bs; 107 + struct bio_set *flush_bs; 110 108 111 109 /* used only for recovery */ 112 110 int recovered_entries; ··· 132 128 sector_t next_io_sector; 133 129 unsigned int entry_space; 134 130 bool use_multippl; 131 + bool wb_cache_on; 132 + unsigned long disk_flush_bitmap; 135 133 }; 136 134 137 135 #define PPL_IO_INLINE_BVECS 32 ··· 151 145 152 146 struct list_head stripe_list; /* stripes added to the io_unit */ 153 147 atomic_t pending_stripes; /* how many stripes not written to raid */ 148 + atomic_t pending_flushes; /* how many disk flushes are in progress */ 154 149 155 150 bool submitted; /* true if write to log started */ 156 151 ··· 256 249 INIT_LIST_HEAD(&io->log_sibling); 257 250 INIT_LIST_HEAD(&io->stripe_list); 258 251 atomic_set(&io->pending_stripes, 0); 252 + atomic_set(&io->pending_flushes, 0); 259 253 bio_init(&io->bio, io->biovec, PPL_IO_INLINE_BVECS); 260 254 261 255 pplhdr = page_address(io->header_page); ··· 483 475 if (log->use_multippl) 484 476 log->next_io_sector += (PPL_HEADER_SIZE + io->pp_size) >> 9; 485 477 478 + WARN_ON(log->disk_flush_bitmap != 0); 479 + 486 480 list_for_each_entry(sh, &io->stripe_list, log_list) { 481 + for (i = 0; i < sh->disks; i++) { 482 + struct r5dev *dev = &sh->dev[i]; 483 + 484 + if ((ppl_conf->child_logs[i].wb_cache_on) && 485 + (test_bit(R5_Wantwrite, &dev->flags))) { 486 + set_bit(i, &log->disk_flush_bitmap); 487 + } 488 + } 489 + 487 490 /* entries for full stripe writes have no partial parity */ 488 491 if (test_bit(STRIPE_FULL_WRITE, &sh->state)) 489 492 continue; ··· 559 540 { 560 541 struct ppl_log *log = io->log; 561 542 struct ppl_conf *ppl_conf = log->ppl_conf; 543 + struct r5conf *conf = ppl_conf->mddev->private; 562 544 unsigned long flags; 563 545 564 546 pr_debug("%s: seq: %llu\n", __func__, io->seq); ··· 585 565 spin_unlock(&ppl_conf->no_mem_stripes_lock); 586 566 587 567 local_irq_restore(flags); 568 + 569 + wake_up(&conf->wait_for_quiescent); 570 + } 571 + 572 + static void ppl_flush_endio(struct bio *bio) 573 + { 574 + struct ppl_io_unit *io = bio->bi_private; 575 + struct ppl_log *log = io->log; 576 + struct ppl_conf *ppl_conf = log->ppl_conf; 577 + struct r5conf *conf = ppl_conf->mddev->private; 578 + char b[BDEVNAME_SIZE]; 579 + 580 + pr_debug("%s: dev: %s\n", __func__, bio_devname(bio, b)); 581 + 582 + if (bio->bi_status) { 583 + struct md_rdev *rdev; 584 + 585 + rcu_read_lock(); 586 + rdev = md_find_rdev_rcu(conf->mddev, bio_dev(bio)); 587 + if (rdev) 588 + md_error(rdev->mddev, rdev); 589 + rcu_read_unlock(); 590 + } 591 + 592 + bio_put(bio); 593 + 594 + if (atomic_dec_and_test(&io->pending_flushes)) { 595 + ppl_io_unit_finished(io); 596 + md_wakeup_thread(conf->mddev->thread); 597 + } 598 + } 599 + 600 + static void ppl_do_flush(struct ppl_io_unit *io) 601 + { 602 + struct ppl_log *log = io->log; 603 + struct ppl_conf *ppl_conf = log->ppl_conf; 604 + struct r5conf *conf = ppl_conf->mddev->private; 605 + int raid_disks = conf->raid_disks; 606 + int flushed_disks = 0; 607 + int i; 608 + 609 + atomic_set(&io->pending_flushes, raid_disks); 610 + 611 + for_each_set_bit(i, &log->disk_flush_bitmap, raid_disks) { 612 + struct md_rdev *rdev; 613 + struct block_device *bdev = NULL; 614 + 615 + rcu_read_lock(); 616 + rdev = rcu_dereference(conf->disks[i].rdev); 617 + if (rdev && !test_bit(Faulty, &rdev->flags)) 618 + bdev = rdev->bdev; 619 + rcu_read_unlock(); 620 + 621 + if (bdev) { 622 + struct bio *bio; 623 + char b[BDEVNAME_SIZE]; 624 + 625 + bio = bio_alloc_bioset(GFP_NOIO, 0, ppl_conf->flush_bs); 626 + bio_set_dev(bio, bdev); 627 + bio->bi_private = io; 628 + bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH; 629 + bio->bi_end_io = ppl_flush_endio; 630 + 631 + pr_debug("%s: dev: %s\n", __func__, 632 + bio_devname(bio, b)); 633 + 634 + submit_bio(bio); 635 + flushed_disks++; 636 + } 637 + } 638 + 639 + log->disk_flush_bitmap = 0; 640 + 641 + for (i = flushed_disks ; i < raid_disks; i++) { 642 + if (atomic_dec_and_test(&io->pending_flushes)) 643 + ppl_io_unit_finished(io); 644 + } 645 + } 646 + 647 + static inline bool ppl_no_io_unit_submitted(struct r5conf *conf, 648 + struct ppl_log *log) 649 + { 650 + struct ppl_io_unit *io; 651 + 652 + io = list_first_entry_or_null(&log->io_list, struct ppl_io_unit, 653 + log_sibling); 654 + 655 + return !io || !io->submitted; 656 + } 657 + 658 + void ppl_quiesce(struct r5conf *conf, int quiesce) 659 + { 660 + struct ppl_conf *ppl_conf = conf->log_private; 661 + int i; 662 + 663 + if (quiesce) { 664 + for (i = 0; i < ppl_conf->count; i++) { 665 + struct ppl_log *log = &ppl_conf->child_logs[i]; 666 + 667 + spin_lock_irq(&log->io_list_lock); 668 + wait_event_lock_irq(conf->wait_for_quiescent, 669 + ppl_no_io_unit_submitted(conf, log), 670 + log->io_list_lock); 671 + spin_unlock_irq(&log->io_list_lock); 672 + } 673 + } 588 674 } 589 675 590 676 void ppl_stripe_write_finished(struct stripe_head *sh) ··· 700 574 io = sh->ppl_io; 701 575 sh->ppl_io = NULL; 702 576 703 - if (io && atomic_dec_and_test(&io->pending_stripes)) 704 - ppl_io_unit_finished(io); 577 + if (io && atomic_dec_and_test(&io->pending_stripes)) { 578 + if (io->log->disk_flush_bitmap) 579 + ppl_do_flush(io); 580 + else 581 + ppl_io_unit_finished(io); 582 + } 705 583 } 706 584 707 585 static void ppl_xor(int size, struct page *page1, struct page *page2) ··· 1238 1108 1239 1109 if (ppl_conf->bs) 1240 1110 bioset_free(ppl_conf->bs); 1111 + if (ppl_conf->flush_bs) 1112 + bioset_free(ppl_conf->flush_bs); 1241 1113 mempool_destroy(ppl_conf->io_pool); 1242 1114 kmem_cache_destroy(ppl_conf->io_kc); 1243 1115 ··· 1305 1173 1306 1174 static void ppl_init_child_log(struct ppl_log *log, struct md_rdev *rdev) 1307 1175 { 1176 + struct request_queue *q; 1177 + 1308 1178 if ((rdev->ppl.size << 9) >= (PPL_SPACE_SIZE + 1309 1179 PPL_HEADER_SIZE) * 2) { 1310 1180 log->use_multippl = true; ··· 1319 1185 PPL_HEADER_SIZE; 1320 1186 } 1321 1187 log->next_io_sector = rdev->ppl.sector; 1188 + 1189 + q = bdev_get_queue(rdev->bdev); 1190 + if (test_bit(QUEUE_FLAG_WC, &q->queue_flags)) 1191 + log->wb_cache_on = true; 1322 1192 } 1323 1193 1324 1194 int ppl_init_log(struct r5conf *conf) ··· 1330 1192 struct ppl_conf *ppl_conf; 1331 1193 struct mddev *mddev = conf->mddev; 1332 1194 int ret = 0; 1195 + int max_disks; 1333 1196 int i; 1334 - bool need_cache_flush = false; 1335 1197 1336 1198 pr_debug("md/raid:%s: enabling distributed Partial Parity Log\n", 1337 1199 mdname(conf->mddev)); ··· 1357 1219 return -EINVAL; 1358 1220 } 1359 1221 1222 + max_disks = FIELD_SIZEOF(struct ppl_log, disk_flush_bitmap) * 1223 + BITS_PER_BYTE; 1224 + if (conf->raid_disks > max_disks) { 1225 + pr_warn("md/raid:%s PPL doesn't support over %d disks in the array\n", 1226 + mdname(mddev), max_disks); 1227 + return -EINVAL; 1228 + } 1229 + 1360 1230 ppl_conf = kzalloc(sizeof(struct ppl_conf), GFP_KERNEL); 1361 1231 if (!ppl_conf) 1362 1232 return -ENOMEM; ··· 1386 1240 1387 1241 ppl_conf->bs = bioset_create(conf->raid_disks, 0, BIOSET_NEED_BVECS); 1388 1242 if (!ppl_conf->bs) { 1243 + ret = -ENOMEM; 1244 + goto err; 1245 + } 1246 + 1247 + ppl_conf->flush_bs = bioset_create(conf->raid_disks, 0, 0); 1248 + if (!ppl_conf->flush_bs) { 1389 1249 ret = -ENOMEM; 1390 1250 goto err; 1391 1251 } ··· 1427 1275 log->rdev = rdev; 1428 1276 1429 1277 if (rdev) { 1430 - struct request_queue *q; 1431 - 1432 1278 ret = ppl_validate_rdev(rdev); 1433 1279 if (ret) 1434 1280 goto err; 1435 1281 1436 - q = bdev_get_queue(rdev->bdev); 1437 - if (test_bit(QUEUE_FLAG_WC, &q->queue_flags)) 1438 - need_cache_flush = true; 1439 1282 ppl_init_child_log(log, rdev); 1440 1283 } 1441 1284 } 1442 - 1443 - if (need_cache_flush) 1444 - pr_warn("md/raid:%s: Volatile write-back cache should be disabled on all member drives when using PPL!\n", 1445 - mdname(mddev)); 1446 1285 1447 1286 /* load and possibly recover the logs from the member disks */ 1448 1287 ret = ppl_load(ppl_conf);
+13 -3
drivers/md/raid5.c
··· 5563 5563 bool do_flush = false; 5564 5564 5565 5565 if (unlikely(bi->bi_opf & REQ_PREFLUSH)) { 5566 - int ret = r5l_handle_flush_request(conf->log, bi); 5566 + int ret = log_handle_flush_request(conf, bi); 5567 5567 5568 5568 if (ret == 0) 5569 5569 return true; ··· 6168 6168 break; 6169 6169 if (i == NR_STRIPE_HASH_LOCKS) { 6170 6170 spin_unlock_irq(&conf->device_lock); 6171 - r5l_flush_stripe_to_raid(conf->log); 6171 + log_flush_stripe_to_raid(conf); 6172 6172 spin_lock_irq(&conf->device_lock); 6173 6173 return batch_size; 6174 6174 } ··· 8060 8060 wake_up(&conf->wait_for_overlap); 8061 8061 unlock_all_device_hash_locks_irq(conf); 8062 8062 } 8063 - r5l_quiesce(conf->log, quiesce); 8063 + log_quiesce(conf, quiesce); 8064 8064 } 8065 8065 8066 8066 static void *raid45_takeover_raid0(struct mddev *mddev, int level) ··· 8364 8364 return err; 8365 8365 } 8366 8366 8367 + static int raid5_start(struct mddev *mddev) 8368 + { 8369 + struct r5conf *conf = mddev->private; 8370 + 8371 + return r5l_start(conf->log); 8372 + } 8373 + 8367 8374 static struct md_personality raid6_personality = 8368 8375 { 8369 8376 .name = "raid6", ··· 8378 8371 .owner = THIS_MODULE, 8379 8372 .make_request = raid5_make_request, 8380 8373 .run = raid5_run, 8374 + .start = raid5_start, 8381 8375 .free = raid5_free, 8382 8376 .status = raid5_status, 8383 8377 .error_handler = raid5_error, ··· 8403 8395 .owner = THIS_MODULE, 8404 8396 .make_request = raid5_make_request, 8405 8397 .run = raid5_run, 8398 + .start = raid5_start, 8406 8399 .free = raid5_free, 8407 8400 .status = raid5_status, 8408 8401 .error_handler = raid5_error, ··· 8429 8420 .owner = THIS_MODULE, 8430 8421 .make_request = raid5_make_request, 8431 8422 .run = raid5_run, 8423 + .start = raid5_start, 8432 8424 .free = raid5_free, 8433 8425 .status = raid5_status, 8434 8426 .error_handler = raid5_error,