diff options
author | NeilBrown <neilb@suse.de> | 2011-01-13 23:14:34 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-01-13 23:14:34 +0100 |
commit | 75d3da43cb74d2e5fb87816dbfecb839cd97c7f4 (patch) | |
tree | 27074aceb801ada315329591f32c938b36150ed9 /drivers/md/md.c | |
parent | md: separate meta and data devs (diff) | |
download | linux-75d3da43cb74d2e5fb87816dbfecb839cd97c7f4.tar.xz linux-75d3da43cb74d2e5fb87816dbfecb839cd97c7f4.zip |
md: Don't let implementation detail of curr_resync leak out through sysfs.
mddev->curr_resync has artificial values of '1' and '2' which are used
by the code which ensures only one resync is happening at a time on
any given device.
These values are internal and should never be exposed to user-space
(except when translated appropriately as in the 'pending' status in
/proc/mdstat).
Unfortunately they are as ->curr_resync is assigned to
->curr_resync_completed and that value is directly visible through
sysfs.
So change the assignments to ->curr_resync_completed to get the same
valued from elsewhere in a form that doesn't have the magic '1' or '2'
values.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index b98a85fd10b6..42b1d9ead7f2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6824,7 +6824,7 @@ void md_do_sync(mddev_t *mddev) desc, mdname(mddev)); mddev->curr_resync = j; } - mddev->curr_resync_completed = mddev->curr_resync; + mddev->curr_resync_completed = j; while (j < max_sectors) { sector_t sectors; @@ -6842,8 +6842,7 @@ void md_do_sync(mddev_t *mddev) md_unplug(mddev); wait_event(mddev->recovery_wait, atomic_read(&mddev->recovery_active) == 0); - mddev->curr_resync_completed = - mddev->curr_resync; + mddev->curr_resync_completed = j; set_bit(MD_CHANGE_CLEAN, &mddev->flags); sysfs_notify(&mddev->kobj, NULL, "sync_completed"); } |