lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH RESEND] md: allow to set the fail_fast on RAID1/RAID10
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

\
 
 \ /
  Last update: 2021-10-13 09:59    [W:0.547 / U:1.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site