linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: majianpeng <majianpeng@gmail.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: Question about handle_failed_sync()
Date: Wed, 14 Mar 2012 18:28:27 +1100	[thread overview]
Message-ID: <20120314182827.4738c70c@notabene.brown> (raw)
In-Reply-To: <201203141516404211761@gmail.com>

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

On Wed, 14 Mar 2012 15:16:45 +0800 "majianpeng" <majianpeng@gmail.com> wrote:

>  In function handle_failed_sync():
> >>/* During recovery devices cannot be removed, so locking and
> >>	 * refcounting of rdevs is not needed
> >>	 */
> >>	for (i = 0; i < conf->raid_disks; i++) {
> >>		struct md_rdev *rdev = conf->disks[i].rdev;
> >>		if (rdev
> >>		    && !test_bit(Faulty, &rdev->flags)
> >>		    && !test_bit(In_sync, &rdev->flags)
> >>		    && !rdev_set_badblocks(rdev, sh->sector,
> >>					   STRIPE_SECTORS, 0))
> >>			abort = 1;
> 
> I have two questions:
> 1:if raid have two or more spare disks, it wil set bad block on all spare disk. Is it worth it?

This is not looking at spare disks exactly.  Rather it is looking at
devices that are being recovered - they were spares by now they are member of
the array that are being recovered.
So there will only be 2 in RAID6 and never more.

And yes, it is worth it.


> 2:If raid have two or more spare disks,I can remove spare disks which not working for recovery.Then you shold add locking 
>    and refconting.

I'm not iterating through the list of disks (mddev->disks) here - just
through the list of devices that are active members of the array
(conf->disks).
You cannot remove those while recovery is happening.

Thanks,
NeilBrown



>  				
> --------------
> majianpeng
> 2012-03-14
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

      reply	other threads:[~2012-03-14  7:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14  7:16 Question about handle_failed_sync() majianpeng
2012-03-14  7:28 ` NeilBrown [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=20120314182827.4738c70c@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=majianpeng@gmail.com \
    /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).