Commit 2aa80952 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: Make MD device-is-idle test check whole device, not partition.

When resyncing an array, md will back off if it detects other
activity on the device.  This used to be based on the whole
device, not the partition, but recent changes made it only
check IO on the partition.

This patch causes all sync_io accounting to be done on the
whole device (bdev->bd_contains).
parent fb6b2f61
...@@ -2742,7 +2742,7 @@ int unregister_md_personality(int pnum) ...@@ -2742,7 +2742,7 @@ int unregister_md_personality(int pnum)
void md_sync_acct(mdk_rdev_t *rdev, unsigned long nr_sectors) void md_sync_acct(mdk_rdev_t *rdev, unsigned long nr_sectors)
{ {
rdev->bdev->bd_disk->sync_io += nr_sectors; rdev->bdev->bd_contains->bd_disk->sync_io += nr_sectors;
} }
static int is_mddev_idle(mddev_t *mddev) static int is_mddev_idle(mddev_t *mddev)
...@@ -2754,7 +2754,7 @@ static int is_mddev_idle(mddev_t *mddev) ...@@ -2754,7 +2754,7 @@ static int is_mddev_idle(mddev_t *mddev)
idle = 1; idle = 1;
ITERATE_RDEV(mddev,rdev,tmp) { ITERATE_RDEV(mddev,rdev,tmp) {
struct gendisk *disk = rdev->bdev->bd_disk; struct gendisk *disk = rdev->bdev->bd_contains->bd_disk;
curr_events = disk->read_sectors + disk->write_sectors - disk->sync_io; curr_events = disk->read_sectors + disk->write_sectors - disk->sync_io;
if ((curr_events - rdev->last_events) > 32) { if ((curr_events - rdev->last_events) > 32) {
rdev->last_events = curr_events; rdev->last_events = curr_events;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment