Thread (12 messages) flat view 12 messages, 3 authors, 2021-10-13

Re: [PATCH RESEND] md: allow to set the fail_fast on RAID1/RAID10

From: Xiao Ni <hidden>
Date: 2021-10-13 07:58:13
Also in: lkml

On Tue, Oct 12, 2021 at 5:14 PM Li Feng [off-list ref] wrote:
quoted
         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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help