Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1623711rwl; Wed, 29 Mar 2023 22:10:10 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2sgoNMh8aeSC+1NrODMpjZlgiymTHb3h9ptSBbDsyfBEckR2cevs5GAAh21Jh4ZgYJU0G X-Received: by 2002:a05:6a20:8e19:b0:dd:dfe4:f06a with SMTP id y25-20020a056a208e1900b000dddfe4f06amr1059064pzj.3.1680153010286; Wed, 29 Mar 2023 22:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680153010; cv=none; d=google.com; s=arc-20160816; b=Tg/YlxuXvQfsWhID1N15juZ4J2N09HGnR21COTE6s7ygkvBht+gfEfZR9a356ROrDz fPOk2X9aCSwfAzOOO8TlmAIcUYy4CxT/7FhO1Kw42vA2noan68e5vTQJOgmA8G+CdZTV V2RfE1ZEY/SO7XJsD581GxR1Mk8udASPXk59VZcj84svf9cH5MOT3qDTURR7D8Wa8gSR XMXCv5FIiXlV9SLETKaMJi5j76DID7E41qHysMwD1Tj7GTRtgBN5mFGnBKfggq+CbyHK nGqyEmW5N9WD5bXbBJ4+N+B6u2JfF21wARDdaou4F3Af9oUKkoU3i2K5a2MZTJKf1Qci hdLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AyTbRFMs97cAScAt4h83Kngqndm2W6jMyHVf8nQ7nPc=; b=gn3MGTEqXNBGmHCOxyf25/ZsssPbmFT4JWRPs/uJwEVMQ2+A1MvXsnfzF1TC4a6FbB G0uGma25AnefX+S/4WLkKc3RSY6yXDEz4MT9kZfBzCSbzLlxMvrH1y0VgrTPcXh/JMxz AqZbyqvBKXkpTP+APbmGIu3SJRme79XUXbL6DOfGkqrvDRcTaleE01o6tFq4U722vwuG M7GIYYcCWGVa2LHV8dBt1VLigOg6q24GYrQVyIeDG4BFULg/V/yGoGdZ8eAaa0wyV6aB g7BNRZhIdnZtlLeRQfapupqu9CbgykY5R0w0WxISJt8L90KoEb5K6Q+rKc3KKb5Rwkd4 Q2RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dQDHGpPu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f20-20020a63f114000000b00502d85bfb5fsi18472466pgi.451.2023.03.29.22.09.58; Wed, 29 Mar 2023 22:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dQDHGpPu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229649AbjC3E4S (ORCPT + 99 others); Thu, 30 Mar 2023 00:56:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjC3E4R (ORCPT ); Thu, 30 Mar 2023 00:56:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6272F46B5 for ; Wed, 29 Mar 2023 21:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680152129; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AyTbRFMs97cAScAt4h83Kngqndm2W6jMyHVf8nQ7nPc=; b=dQDHGpPuLCN00hw3XJqoij0LwNB88MKXgstw7zg3fqtWkPITHLdy2Arfk1kpU5nJ7lAdQK zrHhtBjfXmQyPvYxHj+f/ECPCtsIG4kOsbUkIE2rLrHGwaO6Oirhtbl7b58fBmDDSBk1D5 6utp4tUI1kTVki0d2relto2NyDJ1p5Y= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-08UqUbOiPj-daejRVn20WQ-1; Thu, 30 Mar 2023 00:55:20 -0400 X-MC-Unique: 08UqUbOiPj-daejRVn20WQ-1 Received: by mail-pg1-f197.google.com with SMTP id bc19-20020a656d93000000b005072b17a298so4992036pgb.14 for ; Wed, 29 Mar 2023 21:55:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680152119; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AyTbRFMs97cAScAt4h83Kngqndm2W6jMyHVf8nQ7nPc=; b=k7Brj2b6XkhIUKy5lPjo7ADp7G28MZS6M+4paMNDFRUd7Q0r0hS10u61nq1BxefBlg CGF6yAOc1cIzO4RW5tGjUruooOM9eU8CDN1aya7CeKEiMgU2/whE+38UBa5rJKK4Cicu 3fzH0mnPQqsR9JpTDeEoNl9NhU4puZ+RA3GWmAtEHdNDKOCrT3iHIs5BSZb66EJHtEpe PVp6lfUiI6yLez2x+tb2Vl71uwKeUNCbI5kYRTM+YoqgujR8KIATfpLlmzhmhCx2GWiI 4myOYuANV2vD3IUNNq+gOpIVeNI8Ls2KFLafP8uoRRB/jLvFkU1hfmzZpEmvjkwfka0L /4wQ== X-Gm-Message-State: AAQBX9dLy1aDMcs7OxVRC8kO5Ql0Jn2dH1H71xdGQiaPiotoEqF8OEYA TEHX42N2tE00NsR9cW0XbQjm3NMudMearvOosoNtvz92/OaEHAFkAHBRpitahSgq0OKM5pSlBlA /Xx8HiROzKL3muCp2kG90uz0AZyR8owTEaYyfuMon19pUbiWimqe8AQ== X-Received: by 2002:a17:903:455:b0:1a2:6e4d:782c with SMTP id iw21-20020a170903045500b001a26e4d782cmr1824098plb.13.1680152119327; Wed, 29 Mar 2023 21:55:19 -0700 (PDT) X-Received: by 2002:a17:903:455:b0:1a2:6e4d:782c with SMTP id iw21-20020a170903045500b001a26e4d782cmr1824087plb.13.1680152118983; Wed, 29 Mar 2023 21:55:18 -0700 (PDT) MIME-Version: 1.0 References: <167875238571.8008.9808655454439667586@noble.neil.brown.name> <167945548970.8008.8910680813298326328@noble.neil.brown.name> <168012671413.8106.6812573281942242445@noble.neil.brown.name> <168014613094.14629.7292916705339147692@noble.neil.brown.name> In-Reply-To: <168014613094.14629.7292916705339147692@noble.neil.brown.name> From: Xiao Ni Date: Thu, 30 Mar 2023 12:55:07 +0800 Message-ID: Subject: Re: [PATCH - mdadm] mdopen: always try create_named_array() To: NeilBrown Cc: Jes Sorensen , Mariusz Tkaczyk , Song Liu , Linux regressions mailing list , linux-raid , LKML , Nikolay Kichukov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 30, 2023 at 11:15=E2=80=AFAM NeilBrown wrote: > > On Thu, 30 Mar 2023, Xiao Ni wrote: > > On Thu, Mar 30, 2023 at 5:52=E2=80=AFAM NeilBrown wrote= : > > > > > > On Wed, 22 Mar 2023, NeilBrown wrote: > > > > On Wed, 22 Mar 2023, Xiao Ni wrote: > > > > > > > > > > > > > > Second, are there possibilities that the arguments "dev" and "nam= e" of > > > > > function create_mddev > > > > > are null at the same time? > > > > > > > > No. For Build or Create, dev is never NULL. For Assemble and > > > > Incremental, name is never NULL. > > > > > > > > > > I should clarify this a bit. For Assemble and Incremental, "name" is > > > never NULL *but* it might be an empty string. > > > So: > > > if (name && name[0] =3D=3D 0) > > > name =3D NULL; > > > > > > might cause it to become NULL. So you cannot assume there is always > > > either a valid "dev" or a valid "name". "dev" might be NULL, and "na= me" > > > might be "". > > > > > > NeilBrown > > > > > > > Hi Neil > > > > The input argument name should be the metadata name. For incremental > > and assemble, why are there possibilities that the metadata name is > > invalid? A raid device should have a valid metadata name, right? > > "should" do, yes. But you can never completely trust data on disk. It > is safest to be prepared for "name" being "". > > NeilBrown > That's right, thanks for this explanation :) --=20 Best Regards Xiao Ni