diff options
author | Rémi Rérolle <rrerolle@lacie.com> | 2011-01-13 17:14:34 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-01-13 17:14:34 -0500 |
commit | 13ae864bc86ff65547ffe7e966b6433a0d0edb8a (patch) | |
tree | 6e5ca3a6736b75fa0db8415c1e3a2506af6ab9cc /drivers/md | |
parent | 23ddff3792f61193695114c68d6ebd57e974c4f8 (diff) |
md: fix sync_completed reporting for very large drives (>2TB)
The values exported in the sync_completed file are unsigned long, which
overflows with very large drives, resulting in wrong values reported.
Since sync_completed uses sectors as unit, we'll start getting wrong
values with components larger than 2TB.
This patch simply replaces the use of unsigned long by unsigned long long.
Signed-off-by: Rémi Rérolle <rrerolle@lacie.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-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 dd64ad30a0fe..5e3714fecee9 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -3918,7 +3918,7 @@ static struct md_sysfs_entry md_sync_speed = __ATTR_RO(sync_speed); | |||
3918 | static ssize_t | 3918 | static ssize_t |
3919 | sync_completed_show(mddev_t *mddev, char *page) | 3919 | sync_completed_show(mddev_t *mddev, char *page) |
3920 | { | 3920 | { |
3921 | unsigned long max_sectors, resync; | 3921 | unsigned long long max_sectors, resync; |
3922 | 3922 | ||
3923 | if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) | 3923 | if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) |
3924 | return sprintf(page, "none\n"); | 3924 | return sprintf(page, "none\n"); |
@@ -3929,7 +3929,7 @@ sync_completed_show(mddev_t *mddev, char *page) | |||
3929 | max_sectors = mddev->dev_sectors; | 3929 | max_sectors = mddev->dev_sectors; |
3930 | 3930 | ||
3931 | resync = mddev->curr_resync_completed; | 3931 | resync = mddev->curr_resync_completed; |
3932 | return sprintf(page, "%lu / %lu\n", resync, max_sectors); | 3932 | return sprintf(page, "%llu / %llu\n", resync, max_sectors); |
3933 | } | 3933 | } |
3934 | 3934 | ||
3935 | static struct md_sysfs_entry md_sync_completed = __ATTR_RO(sync_completed); | 3935 | static struct md_sysfs_entry md_sync_completed = __ATTR_RO(sync_completed); |