From: Guoqing Jiang <guoqing.jiang@linux.dev>
To: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Cc: song@kernel.org, linux-raid@vger.kernel.org
Subject: Re: [PATCH 1/3] raid0, linear, md: add error_handlers for raid0 and linear
Date: Tue, 15 Feb 2022 11:43:34 +0800 [thread overview]
Message-ID: <67429e77-f669-87f7-c2db-aaa4f545590b@linux.dev> (raw)
In-Reply-To: <20220214103738.000017f8@linux.intel.com>
On 2/14/22 5:37 PM, Mariusz Tkaczyk wrote:
> On Sat, 12 Feb 2022 09:12:00 +0800
> Guoqing Jiang <guoqing.jiang@linux.dev> wrote:
>
>> On 1/27/22 11:39 PM, Mariusz Tkaczyk wrote:
>>> Patch 62f7b1989c0 ("md raid0/linear: Mark array as 'broken' and
>>> fail BIOs if a member is gone") allowed to finish writes earlier
>>> (before level dependent actions) for non-redundant arrays.
>>>
>>> To achieve that MD_BROKEN is added to mddev->flags if drive
>>> disappearance is detected. This is done in is_mddev_broken() which
>>> is confusing and not consistent with other levels where
>>> error_handler() is used. This patch adds appropriate error_handler
>>> for raid0 and linear.
>> I think the purpose of them are quite different, as said before,
>> error_handler
>> is mostly against rdev while is_mddev_broken is for mddev though it
>> needs to test rdev first.
> I changed is_mddev_broken to is_rdev_broken, because it checks the
> device now. On error it calls md_error and later error_handler.
> I unified error handling for each level. Do you consider it as wrong?
I am neutral to the change
>> It also adopts md_error(), we only want to call .error_handler for
>> those levels. mddev->pers->sync_request is additionally checked,
>> its existence implies a level with redundancy.
>>
>> Usage of error_handler causes that disk failure can be requested
>> from userspace. User can fail the array via #mdadm --set-faulty
>> command. This is not safe and will be fixed in mdadm.
>> What is the safe issue here? It would betterr to post mdadm fix
>> together.
> We can and should block user from damaging raid even if it is
> recoverable. It is a regression.
I don't follow, did you mean --set-fault from mdadm could "damaging raid"?
> I will fix mdadm. I don't consider it as a big risk (because it is
> recoverable) so I focused on kernel part first.
>
>>> It is correctable because failed
>>> state is not recorded in the metadata. After next assembly array
>>> will be read-write again.
>> I don't think it is a problem, care to explain why it can't be RW
>> again?
> failed state is not recoverable in runtime, so you need to recreate
> array.
IIUC, the failfast flag is supposed to be set during transient error not
permanent failure, the rdev (marked as failfast) need to be revalidated
and readded to array.
[ ... ]
>>> + char *md_name = mdname(mddev);
>>> +
>>> + pr_crit("md/linear%s: Disk failure on %pg
>>> detected.\n"
>>> + "md/linear:%s: Cannot continue, failing
>>> array.\n",
>>> + md_name, rdev->bdev, md_name);
>> The second md_name is not needed.
> Could you elaborate here more? Do you want to skip device name in
> second message?
Yes, we printed two md_name here, seems unnecessary.
[ ... ]
>>> --- a/drivers/md/md.c
>>> +++ b/drivers/md/md.c
>>> @@ -7982,7 +7982,11 @@ void md_error(struct mddev *mddev, struct
>>> md_rdev *rdev)
>>> if (!mddev->pers || !mddev->pers->error_handler)
>>> return;
>>> - mddev->pers->error_handler(mddev,rdev);
>>> + mddev->pers->error_handler(mddev, rdev);
>>> +
>>> + if (!mddev->pers->sync_request)
>>> + return;
>> The above only valid for raid0 and linear, I guess it is fine if DM
>> don't create LV on top
>> of them. But the new checking deserves some comment above.
> Will do, could you propose comment?
Or, just check if it is raid0 or linear directly instead of implies
level with
redundancy.
Thanks,
Guoqing
next prev parent reply other threads:[~2022-02-15 3:43 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 15:39 [PATCH v3 0/3] Improve failed arrays handling Mariusz Tkaczyk
2022-01-27 15:39 ` [PATCH 1/3] raid0, linear, md: add error_handlers for raid0 and linear Mariusz Tkaczyk
2022-02-12 1:12 ` Guoqing Jiang
2022-02-14 9:37 ` Mariusz Tkaczyk
2022-02-15 3:43 ` Guoqing Jiang [this message]
2022-02-15 14:06 ` Mariusz Tkaczyk
2022-02-16 9:47 ` Xiao Ni
2022-02-22 6:34 ` Song Liu
2022-02-22 13:02 ` Mariusz Tkaczyk
2022-01-27 15:39 ` [PATCH 2/3] md: Set MD_BROKEN for RAID1 and RAID10 Mariusz Tkaczyk
2022-01-31 8:29 ` Xiao Ni
2022-01-31 9:06 ` Mariusz Tkaczyk
2022-02-08 7:13 ` Song Liu
2022-01-31 12:23 ` Wols Lists
2022-02-12 1:17 ` Guoqing Jiang
2022-02-14 8:55 ` Mariusz Tkaczyk
2022-01-27 15:39 ` [PATCH 3/3] raid5: introduce MD_BROKEN Mariusz Tkaczyk
2022-01-31 8:58 ` Xiao Ni
2022-02-12 1:47 ` Guoqing Jiang
2022-02-22 14:18 ` Mariusz Tkaczyk
2022-02-25 7:22 ` Guoqing Jiang
2022-03-03 16:21 ` Mariusz Tkaczyk
2022-02-08 7:18 ` [PATCH v3 0/3] Improve failed arrays handling Song Liu
-- strict thread matches above, loose matches on Subject: below --
2022-03-22 15:23 [PATCH 0/3] Failed array handling improvements Mariusz Tkaczyk
2022-03-22 15:23 ` [PATCH 1/3] raid0, linear, md: add error_handlers for raid0 and linear Mariusz Tkaczyk
2022-04-08 0:16 ` Song Liu
2022-04-08 14:35 ` Mariusz Tkaczyk
2022-04-08 16:18 ` Song Liu
2022-04-12 15:31 ` Mariusz Tkaczyk
2022-04-12 16:36 ` Song Liu
2021-12-16 14:52 [PATCH v2 0/3] Use MD_BROKEN for redundant arrays Mariusz Tkaczyk
2021-12-16 14:52 ` [PATCH 1/3] raid0, linear, md: add error_handlers for raid0 and linear Mariusz Tkaczyk
2021-12-17 2:00 ` Guoqing Jiang
2021-12-17 2:07 ` Guoqing Jiang
2021-12-19 3:26 ` Xiao Ni
2021-12-22 1:22 ` Guoqing Jiang
2021-12-20 9:39 ` Mariusz Tkaczyk
2021-12-19 3:20 ` Xiao Ni
2021-12-20 8:45 ` Mariusz Tkaczyk
2021-12-21 1:40 ` Xiao Ni
2021-12-21 13:56 ` Mariusz Tkaczyk
2021-12-22 1:54 ` Guoqing Jiang
2021-12-22 3:08 ` Xiao Ni
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=67429e77-f669-87f7-c2db-aaa4f545590b@linux.dev \
--to=guoqing.jiang@linux.dev \
--cc=linux-raid@vger.kernel.org \
--cc=mariusz.tkaczyk@linux.intel.com \
--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).