• Guoqing Jiang's avatar
    md: don't set In_sync if array is frozen · 37153845
    Guoqing Jiang authored
    [ Upstream commit 062f5b2a ]
    
    When a disk is added to array, the following path is called in mdadm.
    
    Manage_subdevs -> sysfs_freeze_array
                   -> Manage_add
                   -> sysfs_set_str(&info, NULL, "sync_action","idle")
    
    Then from kernel side, Manage_add invokes the path (add_new_disk ->
    validate_super = super_1_validate) to set In_sync flag.
    
    Since In_sync means "device is in_sync with rest of array", and the new
    added disk need to resync thread to help the synchronization of data.
    And md_reap_sync_thread would call spare_active to set In_sync for the
    new added disk finally. So don't set In_sync if array is in frozen.
    Signed-off-by: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
    Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    37153845
md.c 246 KB