提交 629acb6a 编写于 作者: J Jonathan Brassow 提交者: NeilBrown

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: NJonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NNeilBrown <neilb@suse.de>
上级 59c5f46f
...@@ -1781,8 +1781,8 @@ int md_integrity_register(mddev_t *mddev) ...@@ -1781,8 +1781,8 @@ int md_integrity_register(mddev_t *mddev)
if (list_empty(&mddev->disks)) if (list_empty(&mddev->disks))
return 0; /* nothing to do */ return 0; /* nothing to do */
if (blk_get_integrity(mddev->gendisk)) if (!mddev->gendisk || blk_get_integrity(mddev->gendisk))
return 0; /* already registered */ return 0; /* shouldn't register, or already is */
list_for_each_entry(rdev, &mddev->disks, same_set) { list_for_each_entry(rdev, &mddev->disks, same_set) {
/* skip spares and non-functional disks */ /* skip spares and non-functional disks */
if (test_bit(Faulty, &rdev->flags)) if (test_bit(Faulty, &rdev->flags))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册