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 'md/4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md

Pull md fixes from Shaohua Li:
"Some MD fixes.

The notable one is a raid5-cache deadlock bug with dm-raid, others are
not significant"

* tag 'md/4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
md/raid1/10: add missed blk plug
md: limit mdstat resync progress to max_sectors
md/r5cache: move mddev_lock() out of r5c_journal_mode_set()
md/raid5: correct degraded calculation in raid5_error

+21 -15
+3 -1
drivers/md/md.c
··· 7605 7605 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) 7606 7606 /* Still cleaning up */ 7607 7607 resync = max_sectors; 7608 - } else 7608 + } else if (resync > max_sectors) 7609 + resync = max_sectors; 7610 + else 7609 7611 resync -= atomic_read(&mddev->recovery_active); 7610 7612 7611 7613 if (resync == 0) {
+4
drivers/md/raid1.c
··· 809 809 spin_lock_irq(&conf->device_lock); 810 810 811 811 if (conf->pending_bio_list.head) { 812 + struct blk_plug plug; 812 813 struct bio *bio; 814 + 813 815 bio = bio_list_get(&conf->pending_bio_list); 814 816 conf->pending_count = 0; 815 817 spin_unlock_irq(&conf->device_lock); 818 + blk_start_plug(&plug); 816 819 flush_bio_list(conf, bio); 820 + blk_finish_plug(&plug); 817 821 } else 818 822 spin_unlock_irq(&conf->device_lock); 819 823 }
+4
drivers/md/raid10.c
··· 894 894 spin_lock_irq(&conf->device_lock); 895 895 896 896 if (conf->pending_bio_list.head) { 897 + struct blk_plug plug; 897 898 struct bio *bio; 899 + 898 900 bio = bio_list_get(&conf->pending_bio_list); 899 901 conf->pending_count = 0; 900 902 spin_unlock_irq(&conf->device_lock); 903 + blk_start_plug(&plug); 901 904 /* flush any pending bitmap writes to disk 902 905 * before proceeding w/ I/O */ 903 906 bitmap_unplug(conf->mddev->bitmap); ··· 921 918 generic_make_request(bio); 922 919 bio = next; 923 920 } 921 + blk_finish_plug(&plug); 924 922 } else 925 923 spin_unlock_irq(&conf->device_lock); 926 924 }
+9 -13
drivers/md/raid5-cache.c
··· 2577 2577 int r5c_journal_mode_set(struct mddev *mddev, int mode) 2578 2578 { 2579 2579 struct r5conf *conf; 2580 - int err; 2581 2580 2582 2581 if (mode < R5C_JOURNAL_MODE_WRITE_THROUGH || 2583 2582 mode > R5C_JOURNAL_MODE_WRITE_BACK) 2584 2583 return -EINVAL; 2585 2584 2586 - err = mddev_lock(mddev); 2587 - if (err) 2588 - return err; 2589 2585 conf = mddev->private; 2590 - if (!conf || !conf->log) { 2591 - mddev_unlock(mddev); 2586 + if (!conf || !conf->log) 2592 2587 return -ENODEV; 2593 - } 2594 2588 2595 2589 if (raid5_calc_degraded(conf) > 0 && 2596 - mode == R5C_JOURNAL_MODE_WRITE_BACK) { 2597 - mddev_unlock(mddev); 2590 + mode == R5C_JOURNAL_MODE_WRITE_BACK) 2598 2591 return -EINVAL; 2599 - } 2600 2592 2601 2593 mddev_suspend(mddev); 2602 2594 conf->log->r5c_journal_mode = mode; 2603 2595 mddev_resume(mddev); 2604 - mddev_unlock(mddev); 2605 2596 2606 2597 pr_debug("md/raid:%s: setting r5c cache mode to %d: %s\n", 2607 2598 mdname(mddev), mode, r5c_journal_mode_str[mode]); ··· 2605 2614 { 2606 2615 int mode = ARRAY_SIZE(r5c_journal_mode_str); 2607 2616 size_t len = length; 2617 + int ret; 2608 2618 2609 2619 if (len < 2) 2610 2620 return -EINVAL; ··· 2617 2625 if (strlen(r5c_journal_mode_str[mode]) == len && 2618 2626 !strncmp(page, r5c_journal_mode_str[mode], len)) 2619 2627 break; 2620 - 2621 - return r5c_journal_mode_set(mddev, mode) ?: length; 2628 + ret = mddev_lock(mddev); 2629 + if (ret) 2630 + return ret; 2631 + ret = r5c_journal_mode_set(mddev, mode); 2632 + mddev_unlock(mddev); 2633 + return ret ?: length; 2622 2634 } 2623 2635 2624 2636 struct md_sysfs_entry
+1 -1
drivers/md/raid5.c
··· 2677 2677 pr_debug("raid456: error called\n"); 2678 2678 2679 2679 spin_lock_irqsave(&conf->device_lock, flags); 2680 + set_bit(Faulty, &rdev->flags); 2680 2681 clear_bit(In_sync, &rdev->flags); 2681 2682 mddev->degraded = raid5_calc_degraded(conf); 2682 2683 spin_unlock_irqrestore(&conf->device_lock, flags); 2683 2684 set_bit(MD_RECOVERY_INTR, &mddev->recovery); 2684 2685 2685 2686 set_bit(Blocked, &rdev->flags); 2686 - set_bit(Faulty, &rdev->flags); 2687 2687 set_mask_bits(&mddev->sb_flags, 0, 2688 2688 BIT(MD_SB_CHANGE_DEVS) | BIT(MD_SB_CHANGE_PENDING)); 2689 2689 pr_crit("md/raid:%s: Disk failure on %s, disabling device.\n"