linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Brassow <jbrassow@redhat.com>
To: linux-raid@vger.kernel.org
Subject: [PATCH] MD: generate an event when array sync is complete
Date: Thu, 14 Jul 2011 15:59:25 -0500	[thread overview]
Message-ID: <1310677165.2246.12.camel@f14.redhat.com> (raw)

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)



             reply	other threads:[~2011-07-14 20:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-14 20:59 Jonathan Brassow [this message]
2011-07-20  1:50 ` [PATCH] MD: generate an event when array sync is complete NeilBrown
2011-07-20 19:16 ` Jonathan Brassow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1310677165.2246.12.camel@f14.redhat.com \
    --to=jbrassow@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).