Skip to content

Commit

Permalink
md: Push down reconstruction log message to personality code.
Browse files Browse the repository at this point in the history
Currently, the md layer checks in analyze_sbs() if the raid level
supports reconstruction (mddev->level >= 1) and if reconstruction is
in progress (mddev->recovery_cp != MaxSector).

Move that printk into the personality code of those raid levels that
care (levels 1, 4, 5, 6, 10).

Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
Andre Noll authored and NeilBrown committed Jun 17, 2009
1 parent 50ac168 commit 8c6ac86
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
9 changes: 0 additions & 9 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -2604,15 +2604,6 @@ static void analyze_sbs(mddev_t * mddev)
clear_bit(In_sync, &rdev->flags);
}
}



if (mddev->recovery_cp != MaxSector &&
mddev->level >= 1)
printk(KERN_ERR "md: %s: raid array is not clean"
" -- starting background reconstruction\n",
mdname(mddev));

}

static void md_safemode_timeout(unsigned long data);
Expand Down
4 changes: 4 additions & 0 deletions drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2052,6 +2052,10 @@ static int run(mddev_t *mddev)
goto out_free_conf;
}

if (mddev->recovery_cp != MaxSector)
printk(KERN_NOTICE "raid1: %s is not clean"
" -- starting background reconstruction\n",
mdname(mddev));
printk(KERN_INFO
"raid1: raid set %s active with %d out of %d mirrors\n",
mdname(mddev), mddev->raid_disks - mddev->degraded,
Expand Down
4 changes: 4 additions & 0 deletions drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,10 @@ static int run(mddev_t *mddev)
goto out_free_conf;
}

if (mddev->recovery_cp != MaxSector)
printk(KERN_NOTICE "raid10: %s is not clean"
" -- starting background reconstruction\n",
mdname(mddev));
printk(KERN_INFO
"raid10: raid set %s active with %d out of %d devices\n",
mdname(mddev), mddev->raid_disks - mddev->degraded,
Expand Down
4 changes: 4 additions & 0 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -4454,6 +4454,10 @@ static int run(mddev_t *mddev)
int working_disks = 0;
mdk_rdev_t *rdev;

if (mddev->recovery_cp != MaxSector)
printk(KERN_NOTICE "raid5: %s is not clean"
" -- starting background reconstruction\n",
mdname(mddev));
if (mddev->reshape_position != MaxSector) {
/* Check that we can continue the reshape.
* Currently only disks can change, it must
Expand Down

0 comments on commit 8c6ac86

Please sign in to comment.