All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Eric Mei <meijia@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: Last working drive in RAID1
Date: Thu, 5 Mar 2015 08:46:34 +1100	[thread overview]
Message-ID: <20150305084634.2d590fe4@notabene.brown> (raw)
In-Reply-To: <54F7633F.3020503@gmail.com>

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

On Wed, 04 Mar 2015 12:55:43 -0700 Eric Mei <meijia@gmail.com> wrote:

> Hi,
> 
> It is interesting to notice that RAID1 won't mark the last working drive 
> as Faulty no matter what. The responsible code seems here:
> 
> static void error(struct mddev *mddev, struct md_rdev *rdev)
> {
>          ...
>          /*
>           * If it is not operational, then we have already marked it as dead
>           * else if it is the last working disks, ignore the error, let the
>           * next level up know.
>           * else mark the drive as failed
>           */
>          if (test_bit(In_sync, &rdev->flags)
>              && (conf->raid_disks - mddev->degraded) == 1) {
>                  /*
>                   * Don't fail the drive, act as though we were just a
>                   * normal single drive.
>                   * However don't try a recovery from this drive as
>                   * it is very likely to fail.
>                   */
>                  conf->recovery_disabled = mddev->recovery_disabled;
>                  return;
>          }
>          ...
> }
> 
> The end result is that even if all the drives are physically gone, there 
> still one drive remains in array forever, and mdadm continues to report 
> the array is degraded instead of failed. RAID10 also has similar behavior.
> 
> Is there any reason we absolutely don't want to fail the last drive of 
> RAID1?
> 

When a RAID1 only has one drive remaining, then it should act as much as
possible like a single plain ordinary drive.

How does /dev/sda behave when you physically remove the device?  md0 (as a
raid1 with one drive) should do the same.

NeilBrown

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  reply	other threads:[~2015-03-04 21:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 19:55 Last working drive in RAID1 Eric Mei
2015-03-04 21:46 ` NeilBrown [this message]
2015-03-04 22:48   ` Eric Mei
2015-03-04 23:26     ` NeilBrown
2015-03-05 15:55       ` Wols Lists
2015-03-05 19:54         ` Eric Mei
2015-03-05 20:00         ` Phil Turmel
2015-03-05 21:52           ` NeilBrown
2015-03-06  9:21             ` Chris
2015-03-05 21:54           ` Chris
2015-03-05 20:23       ` Eric Mei

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=20150305084634.2d590fe4@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=meijia@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 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.