linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Ni <xni@redhat.com>
To: Li Feng <fengli@smartx.com>
Cc: Song Liu <song@kernel.org>,
	"open list:SOFTWARE RAID (Multiple Disks) SUPPORT" 
	<linux-raid@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND] md: allow to set the fail_fast on RAID1/RAID10
Date: Wed, 13 Oct 2021 15:57:57 +0800	[thread overview]
Message-ID: <CALTww29m_RQHbZY6owX2y1_rmOeCEL9rSWg4=shnnitA1RpWQg@mail.gmail.com> (raw)
In-Reply-To: <CAHckoCys6_SG56jzuK0OfFwKb6BtBsUhpp6A70hOKFSeVTWU-Q@mail.gmail.com>

On Tue, Oct 12, 2021 at 5:14 PM Li Feng <fengli@smartx.com> wrote:
> >          sysfs_notify_dirent_safe(rdev->sysfs_state);
> > +    if (need_update_sb)
> > +        if (mddev->pers) {
> > +            set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags);
> > +            md_wakeup_thread(mddev->thread);
> > +        }
> When will mddev->pers is NULL?

The process of creating a raid device is:
1. md_ioctl->md_add_new_disk
2. md_ioctl->do_md_run->md_run->(pers->run)->(mddev->pers = pers)
In md_add_new_disk it creates the per device sysfs files. It can
read/write these
files before setting mddev->pers.

> If it is NULL, this change will not on disk.

I did a test. You are right. Someone can change the per device state
before ADD_NEW_DISK
and RUN_ARRAY ioctl. Please note, the mdadm --create command doesn't
return until RUN_ARRAY
ioctl finishes. Even though the are small, we can try to set MD_SB_CHANGE_DEVS.

Best regards
Xiao


  reply	other threads:[~2021-10-13  7:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08  3:22 [PATCH RESEND] md: allow to set the fail_fast on RAID1/RAID10 Li Feng
2021-10-08 23:35 ` Song Liu
2021-10-11  7:49   ` Xiao Ni
2021-10-11  9:42     ` Li Feng
2021-10-12  6:58       ` Xiao Ni
2021-10-12  8:07         ` Li Feng
2021-10-12  8:17           ` Song Liu
2021-10-12  8:43             ` Li Feng
2021-10-12  8:49               ` Xiao Ni
2021-10-12  9:13                 ` Li Feng
2021-10-13  7:57                   ` Xiao Ni [this message]
2021-10-12 17:20                 ` 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='CALTww29m_RQHbZY6owX2y1_rmOeCEL9rSWg4=shnnitA1RpWQg@mail.gmail.com' \
    --to=xni@redhat.com \
    --cc=fengli@smartx.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).