linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/5] md:Add place to update ->recovery_cp.
@ 2012-10-27  2:28 kernelmail
  2012-10-28 21:35 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: kernelmail @ 2012-10-27  2:28 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

In resyncing, recovery_cp only updated when resync aborted or completed.
But in md drives,many place used it to judge.So add a place to update.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 drivers/md/md.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 1d9940d..01e25bd 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7454,6 +7454,8 @@ void md_do_sync(struct md_thread *thread)
 			wait_event(mddev->recovery_wait,
 				   atomic_read(&mddev->recovery_active) == 0);
 			mddev->curr_resync_completed = j;
+			if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery))
+				mddev->recovery_cp = j;
 			set_bit(MD_CHANGE_CLEAN, &mddev->flags);
 			sysfs_notify(&mddev->kobj, NULL, "sync_completed");
 		}
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/5] md:Add place to update ->recovery_cp.
  2012-10-27  2:28 [PATCH 2/5] md:Add place to update ->recovery_cp kernelmail
@ 2012-10-28 21:35 ` NeilBrown
  2012-10-29  1:30   ` majianpeng
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2012-10-28 21:35 UTC (permalink / raw)
  To: kedacomkernel; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1162 bytes --]

On Sat, 27 Oct 2012 10:28:18 +0800 kernelmail <kedacomkernel@gmail.com> wrote:

> In resyncing, recovery_cp only updated when resync aborted or completed.
> But in md drives,many place used it to judge.So add a place to update.
> 
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
>  drivers/md/md.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 1d9940d..01e25bd 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -7454,6 +7454,8 @@ void md_do_sync(struct md_thread *thread)
>  			wait_event(mddev->recovery_wait,
>  				   atomic_read(&mddev->recovery_active) == 0);
>  			mddev->curr_resync_completed = j;
> +			if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery))
> +				mddev->recovery_cp = j;
>  			set_bit(MD_CHANGE_CLEAN, &mddev->flags);
>  			sysfs_notify(&mddev->kobj, NULL, "sync_completed");
>  		}

This isn't correct.  If MD_RECOVERY_REQUESTED, then j might be less than
recovery_cp and we don't want to reduce recovery_cp.

If you would like to fix that (i.e. only set recovery_cp if it is less than
'j'), then I'll apply the patch.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: [PATCH 2/5] md:Add place to update ->recovery_cp.
  2012-10-28 21:35 ` NeilBrown
@ 2012-10-29  1:30   ` majianpeng
  0 siblings, 0 replies; 3+ messages in thread
From: majianpeng @ 2012-10-29  1:30 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

>On Sat, 27 Oct 2012 10:28:18 +0800 kernelmail <kedacomkernel@gmail.com> wrote:
>
>> In resyncing, recovery_cp only updated when resync aborted or completed.
>> But in md drives,many place used it to judge.So add a place to update.
>> 
>> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
>> ---
>>  drivers/md/md.c |    2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/drivers/md/md.c b/drivers/md/md.c
>> index 1d9940d..01e25bd 100644
>> --- a/drivers/md/md.c
>> +++ b/drivers/md/md.c
>> @@ -7454,6 +7454,8 @@ void md_do_sync(struct md_thread *thread)
>>  			wait_event(mddev->recovery_wait,
>>  				   atomic_read(&mddev->recovery_active) == 0);
>>  			mddev->curr_resync_completed = j;
>> +			if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery))
>> +				mddev->recovery_cp = j;
>>  			set_bit(MD_CHANGE_CLEAN, &mddev->flags);
>>  			sysfs_notify(&mddev->kobj, NULL, "sync_completed");
>>  		}
>
>This isn't correct.  If MD_RECOVERY_REQUESTED, then j might be less than
>recovery_cp and we don't want to reduce recovery_cp.
>
>If you would like to fix that (i.e. only set recovery_cp if it is less than
>'j'), then I'll apply the patch.
>
>NeilBrown
>
Ok, i'll modify and resend to you.
Thanks!
Jianpeng

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-29  1:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-27  2:28 [PATCH 2/5] md:Add place to update ->recovery_cp kernelmail
2012-10-28 21:35 ` NeilBrown
2012-10-29  1:30   ` majianpeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).