diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2012-10-10 22:38:58 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-10-10 22:38:58 -0400 |
commit | 2863b9eb44787adecba4f977d71d7fd876805b1c (patch) | |
tree | e8d5417df70e9ade3b8e021426db6f22b4067b95 /drivers/md/md.c | |
parent | 1ca69c4bc4b1ef889861db39f325901eadbf9497 (diff) |
MD RAID10: Prep for DM RAID10 device replacement capability
MD RAID10: Fix a couple potential kernel panics if RAID10 is used by dm-raid
When device-mapper uses the RAID10 personality through dm-raid.c, there is no
'gendisk' structure in mddev and some sysfs information is also not populated.
This patch avoids touching those non-existent structures.
Signed-off-by: Jonathan Brassow <jbrassow@rehdat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 10 |
1 files changed, 8 insertions, 2 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 */ |
2045 | void md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev) | 2045 | void 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; |