* [PATCH] MD: generate an event when array sync is complete
@ 2011-07-14 20:59 Jonathan Brassow
2011-07-20 1:50 ` NeilBrown
2011-07-20 19:16 ` Jonathan Brassow
0 siblings, 2 replies; 3+ messages in thread
From: Jonathan Brassow @ 2011-07-14 20:59 UTC (permalink / raw)
To: linux-raid
Neil,
I'm not sure this is the best place in the code to put this (even though
I've tested that it works well). I welcome your corrections.
brassow
This patch causes MD to generate an event (for device-mapper) once array
synchronization is complete. This is expected behavior for device-mapper.
RFC-by: Jonathan Brassow <jbrassow@redhat.com>
Index: linux-2.6/drivers/md/md.c
===================================================================
--- linux-2.6.orig/drivers/md/md.c
+++ linux-2.6/drivers/md/md.c
@@ -7328,6 +7328,9 @@ void md_check_recovery(mddev_t *mddev)
unlock:
if (!mddev->sync_thread) {
clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
+ if (mddev->event_work.func && !mddev->recovery &&
+ (mddev->recovery_cp == MaxSector))
+ queue_work(md_misc_wq, &mddev->event_work);
if (test_and_clear_bit(MD_RECOVERY_RECOVER,
&mddev->recovery))
if (mddev->sysfs_action)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] MD: generate an event when array sync is complete
2011-07-14 20:59 [PATCH] MD: generate an event when array sync is complete Jonathan Brassow
@ 2011-07-20 1:50 ` NeilBrown
2011-07-20 19:16 ` Jonathan Brassow
1 sibling, 0 replies; 3+ messages in thread
From: NeilBrown @ 2011-07-20 1:50 UTC (permalink / raw)
To: Jonathan Brassow; +Cc: linux-raid
On Thu, 14 Jul 2011 15:59:25 -0500 Jonathan Brassow <jbrassow@redhat.com>
wrote:
> Neil,
>
> I'm not sure this is the best place in the code to put this (even though
> I've tested that it works well). I welcome your corrections.
>
> brassow
>
> This patch causes MD to generate an event (for device-mapper) once array
> synchronization is complete. This is expected behavior for device-mapper.
>
> RFC-by: Jonathan Brassow <jbrassow@redhat.com>
>
> Index: linux-2.6/drivers/md/md.c
> ===================================================================
> --- linux-2.6.orig/drivers/md/md.c
> +++ linux-2.6/drivers/md/md.c
> @@ -7328,6 +7328,9 @@ void md_check_recovery(mddev_t *mddev)
> unlock:
> if (!mddev->sync_thread) {
> clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
> + if (mddev->event_work.func && !mddev->recovery &&
> + (mddev->recovery_cp == MaxSector))
> + queue_work(md_misc_wq, &mddev->event_work);
> if (test_and_clear_bit(MD_RECOVERY_RECOVER,
> &mddev->recovery))
> if (mddev->sysfs_action)
>
>
Hi Jon,
I think reap_sync_thread would be a better place to put this.
Do you really need all the extra tests though? Would it not be OK to just
notify dmeventd if the resync has stopped, and it can figure out what
actually happened and whether anything needs to be done about it?
I'm happy either way - just thought I would mention it.
So resend with the code in reap_sync_thread and I'll apply.
Thanks,
NeilBrown
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] MD: generate an event when array sync is complete
2011-07-14 20:59 [PATCH] MD: generate an event when array sync is complete Jonathan Brassow
2011-07-20 1:50 ` NeilBrown
@ 2011-07-20 19:16 ` Jonathan Brassow
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Brassow @ 2011-07-20 19:16 UTC (permalink / raw)
To: linux-raid; +Cc: neilb
Neil,
As you said, reap_sync_thread is a much better place for this patch...
brassow
This patch causes MD to generate an event (for device-mapper) when the
synchronization thread is reaped. This is expected behavior for device-mapper.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Index: linux-2.6/drivers/md/md.c
===================================================================
--- linux-2.6.orig/drivers/md/md.c
+++ linux-2.6/drivers/md/md.c
@@ -7148,6 +7148,8 @@ static void reap_sync_thread(mddev_t *md
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
sysfs_notify_dirent_safe(mddev->sysfs_action);
md_new_event(mddev);
+ if (mddev->event_work.func)
+ queue_work(md_misc_wq, &mddev->event_work);
}
/*
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-20 19:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-14 20:59 [PATCH] MD: generate an event when array sync is complete Jonathan Brassow
2011-07-20 1:50 ` NeilBrown
2011-07-20 19:16 ` Jonathan Brassow
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).