Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3210469pxb; Wed, 13 Oct 2021 01:01:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbd4/DSbBnlkt0KcMJ5DbnOv/TLgZVzL15NmLKJz11q9mxJ+ap73+FGi01rmjdqZk5yZM2 X-Received: by 2002:a17:906:4895:: with SMTP id v21mr40100296ejq.299.1634112085848; Wed, 13 Oct 2021 01:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634112085; cv=none; d=google.com; s=arc-20160816; b=IExDlAFTOIG/oFu7jdLgshniDQpvJBGNxlQfJq8P7lJWMjjfcBEsTcaFsowCu8nTAC /1jbp23xqqG2bQ83pUv+wWxZf/M6thQZmbNLL3jXrvZfvzYkq44QzCdBQDFQj815kIFZ s9OJVrpF6mSlm2FAF5rSB+K2XYQMAjR6TSlHhs8HRZCQCKabW0cVAuV9+M+iMlae1VYX 4tHP8boAOpkdAuJcIi9lSbsMlGxEJN/NyzoiLmBK/vBGc9EP6ODJZ907tb9h79nFsEVJ k/T1Ut1gz5A4YJnydMljjf001UrZNZRQNnNHjSDNpWcQLyimW19uOpInCkrh2AZrxlKd 02CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uwSRG5VpgF9GMHGYBZADyWxlcRVpODekeZlTKT4bouc=; b=dN0qg8oQMGJqxNcOEMMg3+C0tO8C5A8JDCch9OB9qCHkBdihtnq3YMastL3TYxlSK3 FgMbL7XFSfzt9UOqZ4mv8eHQjTi7audoTFxSt7keKOweFSdpxLm6jG0uXrcV7uFRRvh9 5Cltzb0YeAKmCSfgbECaBXFf0vA/XD212zySiMnns18lufIIXgzcawxVdWCSqBXY2zYw 9gIgMwo10BwRRSpBeproJiGIXllADAtFwKZFXmCmAarluZns72kmkWcSey/UOg6W+dSf eYs0WmL6bxC3ZEhzKUk7ar7w075Fhdns2X9NFQkgmB4JWehSw9yedJQYolu21Wx4Yl8V 7aUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ypy5RVkY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt11si33037922ejc.41.2021.10.13.01.00.52; Wed, 13 Oct 2021 01:01:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ypy5RVkY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232692AbhJMIAP (ORCPT + 99 others); Wed, 13 Oct 2021 04:00:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49625 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238713AbhJMIAO (ORCPT ); Wed, 13 Oct 2021 04:00:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634111890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uwSRG5VpgF9GMHGYBZADyWxlcRVpODekeZlTKT4bouc=; b=Ypy5RVkYi8g8mEbcNWwH2h+OWVcr+PzUwwZ5rtygWlhiiDOJzqkfc0qhdYqkDjRokeZ99b l/TIzOuE0zFIeakMAttLgvwYxIT22VnmugJ5oThHmaE807xFaIyLtuY+8ksLZ8NKQIp7Th he48lnswcaIJ/mz7eEqbV8uks+VIM4k= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-521-A6063dyIPX6Tm5sPQaiubA-1; Wed, 13 Oct 2021 03:58:09 -0400 X-MC-Unique: A6063dyIPX6Tm5sPQaiubA-1 Received: by mail-ed1-f72.google.com with SMTP id i7-20020a50d747000000b003db0225d219so1553378edj.0 for ; Wed, 13 Oct 2021 00:58:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uwSRG5VpgF9GMHGYBZADyWxlcRVpODekeZlTKT4bouc=; b=KOSNxGn/K8DuQuHqXG8g8e+ADGclZ0jAsB8KiXXd33ZLaaBeBzm9GJqtUqmrPX+v1w sanzeMyIU2COVbMEeE0+XB2BwQEysDb3hQ1uOTLP8R4FWTgjNZAAetsymOmAfNbPwOzX 26VqHBoaSzuCcuX5YRlwlfpA4ZppdKPbIWp2+AVXug8oF/yKN6xAhZtRlUVoISjEvZ/8 NzZ2ajU1iCheyGnnYfUpzQMOnXNcsIL9HI6Flp3SH8MJQ4qXAoerBaDEVN3mAaWQxMDG vPy/cWIl+InMkLbnU2pzuJDOSdkkw9L+r7+YZE2xt3haKFP41bNjV0FnKyotI9SFgH+D p8Lw== X-Gm-Message-State: AOAM530lIE0B6qbL6TXUr2vOT0rmS1Byhb+8DZ4AqecoTNGjEK7Lnhmm 6X0td1PNiV5iIYYNx4ttOUKBdoQDokAET0a37ge7uQGyllQDSHo9BweqpRrAi+0faHGnzoHZMie MfCYS6Zd6cSrLkPSSzxQRWrot7sPlte0xEA/MNofz X-Received: by 2002:a17:906:6d0a:: with SMTP id m10mr37614245ejr.90.1634111888516; Wed, 13 Oct 2021 00:58:08 -0700 (PDT) X-Received: by 2002:a17:906:6d0a:: with SMTP id m10mr37614226ejr.90.1634111888338; Wed, 13 Oct 2021 00:58:08 -0700 (PDT) MIME-Version: 1.0 References: <20211008032231.1143467-1-fengli@smartx.com> In-Reply-To: From: Xiao Ni Date: Wed, 13 Oct 2021 15:57:57 +0800 Message-ID: Subject: Re: [PATCH RESEND] md: allow to set the fail_fast on RAID1/RAID10 To: Li Feng Cc: Song Liu , "open list:SOFTWARE RAID (Multiple Disks) SUPPORT" , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 12, 2021 at 5:14 PM Li Feng 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