All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] md: don't print the same repeated messages about delayed sync operation
Date: Wed, 17 Aug 2016 10:19:02 -0700	[thread overview]
Message-ID: <20160817171902.GB35041@kernel.org> (raw)
In-Reply-To: <20160816122608.14435-1-artur.paszkiewicz@intel.com>

On Tue, Aug 16, 2016 at 02:26:08PM +0200, Artur Paszkiewicz wrote:
> This fixes a long-standing bug that caused a flood of messages like:
> "md: delaying data-check of md1 until md2 has finished (they share one
> or more physical units)"
> 
> It can be reproduced like this:
> 1. Create at least 3 raid1 arrays on a pair of disks, each on different
>    partitions.
> 2. Request a sync operation like 'check' or 'repair' on 2 arrays by
>    writing to their md/sync_action attribute files. One operation should
>    start and one should be delayed and a message like the above will be
>    printed.
> 3. Issue a write to the third array. Each write will cause 2 copies of
>    the message to be printed.
> 
> This happens when wake_up(&resync_wait) is called, usually by
> md_check_recovery(). Then the delayed sync thread again prints the
> message and is put to sleep. This patch adds a check in md_do_sync() to
> prevent printing this message more than once for the same pair of
> devices.
> 
> Reported-by: Sven Koehler <sven.koehler@gmail.com>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=151801
> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> ---
>  drivers/md/md.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 2c3ab6f..5096b48 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -7862,6 +7862,7 @@ void md_do_sync(struct md_thread *thread)
>  	 */
>  
>  	do {
> +		int mddev2_minor = -1;
>  		mddev->curr_resync = 2;
>  
>  	try_again:
> @@ -7891,10 +7892,14 @@ void md_do_sync(struct md_thread *thread)
>  				prepare_to_wait(&resync_wait, &wq, TASK_INTERRUPTIBLE);
>  				if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
>  				    mddev2->curr_resync >= mddev->curr_resync) {
> -					printk(KERN_INFO "md: delaying %s of %s"
> -					       " until %s has finished (they"
> -					       " share one or more physical units)\n",
> -					       desc, mdname(mddev), mdname(mddev2));
> +					if (mddev2_minor != mddev2->md_minor) {
> +						mddev2_minor = mddev2->md_minor;
> +						printk(KERN_INFO "md: delaying %s of %s"
> +						       " until %s has finished (they"
> +						       " share one or more physical units)\n",
> +						       desc, mdname(mddev),
> +						       mdname(mddev2));
> +					}
>  					mddev_put(mddev2);
>  					if (signal_pending(current))
>  						flush_signals(current);

applied, thanks!

      reply	other threads:[~2016-08-17 17:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16 12:26 [PATCH] md: don't print the same repeated messages about delayed sync operation Artur Paszkiewicz
2016-08-17 17:19 ` Shaohua Li [this message]

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=20160817171902.GB35041@kernel.org \
    --to=shli@kernel.org \
    --cc=artur.paszkiewicz@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.