linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tkaczyk, Mariusz" <mariusz.tkaczyk@linux.intel.com>
To: Song Liu <song@kernel.org>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: [PATCH 1/2] md, raid1, raid10: Set MD_BROKEN for RAID1 and RAID10
Date: Thu, 30 Sep 2021 13:23:08 +0200	[thread overview]
Message-ID: <b42f86e1-f81d-4579-c5f5-443a3386ca63@linux.intel.com> (raw)
In-Reply-To: <CAPhsuW6PNfCXzYYpPLv3R8LOoK2n+v3u_XDg1sXOpaOONnPU4Q@mail.gmail.com>

Hi Song,
On 29.09.2021 03:29, Song Liu wrote:
>>>>>>>
>>>>>>>>                            set_bit(MD_SB_NEED_REWRITE, &mddev->sb_flags);
>>>>>>>>                            set_bit(LastDev, &rdev->flags);
>>>>>>>>                    }
>>>>>>>> @@ -2979,7 +2980,8 @@ state_store(struct md_rdev *rdev, const char *buf,
>>>>>>>> size_t len)
>>>>>>>>            int err = -EINVAL;
>>>>>>>>            if (cmd_match(buf, "faulty") && rdev->mddev->pers) {
>>>>>>>>                    md_error(rdev->mddev, rdev);
>>>>>>>> -               if (test_bit(Faulty, &rdev->flags))
>>>>>>>> +
>>>>>>>> +               if (!test_bit(MD_BROKEN, &rdev->mddev->flags))
>>>>>>>
>>>>>>> I don't think this makes much sense. EBUSY for already failed array
>>>>>>> sounds weird.
>>>>>>> Also, shall we also set MD_BROKEN here?
>>>>>>>
>>>>>> Actually, we just called md_error above, so we don't need to set MD_BROKEN
>>>>>> here.
>>>>>> But we shouldn't return EBUSY in such cases, right?
>>>>>>
>>>>> About EBUSY:
>>>>> This is how it is implemented in mdadm, we are expecting it in
>>>>> case of failure. See my fix[2].
>>>>> I agree that it can be confusing, but this is how it is working.
>>>>> Do you want to change it across mdadm and md?
>>>>> This will break compatibility.
>>>>>
>>>>> About MD_BROKEN:
>>>>> As you see we are determining failure by checking rdev state, if "Faulty"
>>>>> in flags after md_error() is not set, then it assumes that array is
>>>>> failed and EBUSY is returned to userspace.
>>>>
>>>> This changed the behavior for raid0, no?
>>>>
>>>> W/o the change mdadm --fail on raid0 will get EBUSY. W/ this change,
>>>> it will get 0, and the device is NOT marked as faulty, right?
>>>>
>>> See commit mentioned in description. MD_BROKEN is used for raid0,
>>> so EBUSY is returned, same as w/o patch.
> 
> Hmm... I am still confused. In state_store(), md_error is a no-op for raid0,
> which will not set Faulty or MD_BROKEN. So we will get -EBUSY w/o
> the patch and 0 w/ the patch, no? It is probably not a serious issue though.
> 
>
Yeah, you are right. There is no error_handler. I missed that.
Now, I reviewed raid0 again.

With my change result won't be clear for raid0, it is correlated with IO.
When drive disappears and there is IO, then it could return -EBUSY,
raid0_make_request() may set MD_BROKEN first.
In there is no IO then 0 will be returned. I need to close this gap.
Thanks for your curiosity.

So, please tell me, are you ok with idea of this patch? I will send
requested details with v2 but I want to know if I choose good way to close
raid5 issue, which is a main problem.

Thanks,
Mariusz



  reply	other threads:[~2021-09-30 11:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 15:34 [PATCH 0/2] Use MD_BROKEN for redundant arrays Mariusz Tkaczyk
2021-09-17 15:34 ` [PATCH 1/2] md, raid1, raid10: Set MD_BROKEN for RAID1 and RAID10 Mariusz Tkaczyk
2021-09-24 21:09   ` Song Liu
2021-09-24 21:15     ` Song Liu
2021-09-27 14:54       ` Tkaczyk, Mariusz
2021-09-27 22:59         ` Song Liu
2021-09-28  7:33           ` Tkaczyk, Mariusz
2021-09-28  7:55             ` Tkaczyk, Mariusz
2021-09-29  1:29               ` Song Liu
2021-09-30 11:23                 ` Tkaczyk, Mariusz [this message]
2021-09-30 15:56                   ` Song Liu
2021-09-17 15:34 ` [PATCH 2/2] raid5: introduce MD_BROKEN Mariusz Tkaczyk
2021-09-24 21:18   ` Song Liu

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=b42f86e1-f81d-4579-c5f5-443a3386ca63@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@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).