aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.c10
-rw-r--r--drivers/md/raid10.c2
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index feab588adb50..85e6786653ea 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2044,8 +2044,14 @@ EXPORT_SYMBOL(md_integrity_register);
2044/* Disable data integrity if non-capable/non-matching disk is being added */ 2044/* Disable data integrity if non-capable/non-matching disk is being added */
2045void md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev) 2045void md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev)
2046{ 2046{
2047 struct blk_integrity *bi_rdev = bdev_get_integrity(rdev->bdev); 2047 struct blk_integrity *bi_rdev;
2048 struct blk_integrity *bi_mddev = blk_get_integrity(mddev->gendisk); 2048 struct blk_integrity *bi_mddev;
2049
2050 if (!mddev->gendisk)
2051 return;
2052
2053 bi_rdev = bdev_get_integrity(rdev->bdev);
2054 bi_mddev = blk_get_integrity(mddev->gendisk);
2049 2055
2050 if (!bi_mddev) /* nothing to do */ 2056 if (!bi_mddev) /* nothing to do */
2051 return; 2057 return;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 54860604d097..fb5bd607e15c 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1694,7 +1694,7 @@ static int raid10_spare_active(struct mddev *mddev)
1694 && !test_bit(Faulty, &tmp->rdev->flags) 1694 && !test_bit(Faulty, &tmp->rdev->flags)
1695 && !test_and_set_bit(In_sync, &tmp->rdev->flags)) { 1695 && !test_and_set_bit(In_sync, &tmp->rdev->flags)) {
1696 count++; 1696 count++;
1697 sysfs_notify_dirent(tmp->rdev->sysfs_state); 1697 sysfs_notify_dirent_safe(tmp->rdev->sysfs_state);
1698 } 1698 }
1699 } 1699 }
1700 spin_lock_irqsave(&conf->device_lock, flags); 1700 spin_lock_irqsave(&conf->device_lock, flags);