From: Guoqing Jiang <guoqing.jiang@linux.dev>
To: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>,
Song Liu <song@kernel.org>, Xiao Ni <xni@redhat.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: fail_last_dev and FailFast/LastDev flag incompatibility
Date: Fri, 11 Feb 2022 16:49:38 +0800 [thread overview]
Message-ID: <acc4e1ed-2161-fa83-0b87-322cf8c81e3d@linux.dev> (raw)
In-Reply-To: <20220209104046.00004427@linux.intel.com>
On 2/9/22 5:40 PM, Mariusz Tkaczyk wrote:
> Hi All,
> During my work under failed arrays handling[1]*improvements*,
Sorry, I disagree, will comment your new version later.
> I discovered potential issue with "failfast" and metadata writes. In
> commit message[2] Neil mentioned that:
> "If we get a failure writing metadata but the device doesn't
> fail, it must be the last device so we re-write without
> FAILFAST".
>
> Obviously, this is not true for RAID456 (again)[1] but it is also not
> true for RAID1 and RAID10 with "fail_las_dev"[3] functionality enabled.
>
> I did a quick check and can see that setter for "LastDev" flag is
> called if "Faulty" on device is not set. I proposed some changes in the
> area in my patchset[4] but after discussion we decided to drop changes
> here. Current approach is not correct for all branches, so my proposal
> is to change:
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 7b024912f1eb..3daec14ef6b2 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -931,7 +931,7 @@ static void super_written(struct bio *bio)
> pr_err("md: %s gets error=%d\n", __func__,
> blk_status_to_errno(bio->bi_status));
> md_error(mddev, rdev);
> - if (!test_bit(Faulty, &rdev->flags)
> + if (test_bit(MD_BROKEN, mddev->flag)
> && (bio->bi_opf & MD_FAILFAST)) {
> set_bit(MD_SB_NEED_REWRITE, &mddev->sb_flags);
> set_bit(LastDev, &rdev->flags);
IIUC, there is no problem with checking Faulty since super_written is
against rdev while MD_BROKEN is supposed to mean array is broken.
Thanks,
Guoqing
prev parent reply other threads:[~2022-02-11 8:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 9:40 fail_last_dev and FailFast/LastDev flag incompatibility Mariusz Tkaczyk
2022-02-11 6:48 ` Xiao Ni
2022-02-11 7:24 ` Xiao Ni
2022-02-11 7:53 ` Xiao Ni
2022-02-11 8:51 ` Mariusz Tkaczyk
2022-02-11 8:49 ` Guoqing Jiang [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=acc4e1ed-2161-fa83-0b87-322cf8c81e3d@linux.dev \
--to=guoqing.jiang@linux.dev \
--cc=linux-raid@vger.kernel.org \
--cc=mariusz.tkaczyk@linux.intel.com \
--cc=song@kernel.org \
--cc=xni@redhat.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.