Skip to content

Commit

Permalink
MD: no integrity register if no gendisk
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Brassow authored and NeilBrown committed Jun 8, 2011
1 parent 59c5f46 commit 629acb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -1781,8 +1781,8 @@ int md_integrity_register(mddev_t *mddev)

if (list_empty(&mddev->disks))
return 0; /* nothing to do */
if (blk_get_integrity(mddev->gendisk))
return 0; /* already registered */
if (!mddev->gendisk || blk_get_integrity(mddev->gendisk))
return 0; /* shouldn't register, or already is */
list_for_each_entry(rdev, &mddev->disks, same_set) {
/* skip spares and non-functional disks */
if (test_bit(Faulty, &rdev->flags))
Expand Down

0 comments on commit 629acb6

Please sign in to comment.