diff options
author | Jonathan Brassow <jbrassow@f14.redhat.com> | 2011-06-08 01:10:08 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-06-08 01:10:08 -0400 |
commit | 629acb6abac0ef217ee579e14084af2ce7381dbc (patch) | |
tree | 75963147cec3ff2e16aa775d103cb41706e503b0 /drivers/md/md.c | |
parent | 59c5f46fbe01a00eedf54a23789634438bb80603 (diff) |
MD: no integrity register if no gendisk
Don't attempt md_integrity_register if there is no gendisk struct available.
When MD arrays are built via device-mapper, the gendisk structure is not
available via mddev.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index aa640a85bb21..4ea02c634d33 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1781,8 +1781,8 @@ int md_integrity_register(mddev_t *mddev) | |||
1781 | 1781 | ||
1782 | if (list_empty(&mddev->disks)) | 1782 | if (list_empty(&mddev->disks)) |
1783 | return 0; /* nothing to do */ | 1783 | return 0; /* nothing to do */ |
1784 | if (blk_get_integrity(mddev->gendisk)) | 1784 | if (!mddev->gendisk || blk_get_integrity(mddev->gendisk)) |
1785 | return 0; /* already registered */ | 1785 | return 0; /* shouldn't register, or already is */ |
1786 | list_for_each_entry(rdev, &mddev->disks, same_set) { | 1786 | list_for_each_entry(rdev, &mddev->disks, same_set) { |
1787 | /* skip spares and non-functional disks */ | 1787 | /* skip spares and non-functional disks */ |
1788 | if (test_bit(Faulty, &rdev->flags)) | 1788 | if (test_bit(Faulty, &rdev->flags)) |