Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1537177rwl; Wed, 29 Mar 2023 20:24:07 -0700 (PDT) X-Google-Smtp-Source: AK7set/M+rg7vRnmhcgTtVZTQsJp8n9kALFsDZw4oKv9JG/CcGva8Io02uF/pnOlRhobgQRwInIo X-Received: by 2002:a05:6a20:5499:b0:db:7789:237e with SMTP id i25-20020a056a20549900b000db7789237emr25063532pzk.4.1680146646950; Wed, 29 Mar 2023 20:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680146646; cv=none; d=google.com; s=arc-20160816; b=KqmGVqMZ+cjC1X4kkcxg7qutxux4hMqkFMoGTYoLyC4vdQ95F4dEECde3zoScJWOW2 VWH+LmcvU4NMF5tCk29fa4Sofv4VAqP8LTP8KjZdV5q8RUGhCSgyXXxXHVB7sP5wjxB7 T3iGEsotD/lyN3qvSAwtT7sulAe76K8qR+NjPK7hRdKcueHvuFSVL7uH6x2ZqiJT4yU3 4m39GOfPhlIHkQOFvJgu4Laguv8hsVPdbmZsLrBeQs77e5YSFSXDrn/EA9kun+35L022 Bmuub4vPBNGavY0FvsqYC/fUASX9pwSRm6O5Sn+pcb1OP6Cwk2roRpPzlUTp2v3ELtLL 1Dyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=kzy6Pb0I2uQLf973vpyQORm+NRKHxqi2ygEi20JdAb0=; b=GRVXxZCgRJmuxQ2mWao+xi/uMB446Ih+sW7QQ0KWI/2peAFhWdXp1qtH/VuJgJzqZN RsXxL0ncXdibV51cavkNDUafClg0cqPeK5KS/EnLO8FFzbD0w9GYH+fEsM6bUVTlOJQD ycyTD2elM4TaghaQYUFKKExm4Atnkudo/bnvpXZ4P9kQcQD/BH66nXc8FZ3moq7gEFtB NNQCKv3TopXz9YTg5GA25o5LBtGAONUJivvACAXlanD3bt/gxOT4hz6wt5bnFVttfX18 iW9FUP0f6Sq89KZefWtsudJNpmdyj+vxbadyqqDG9NAoB/OiTdvz9jEIZXMH1pMgNr84 OGlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=LG7Kws+F; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u189-20020a6385c6000000b00513a68ca71asi191025pgd.742.2023.03.29.20.23.53; Wed, 29 Mar 2023 20:24:06 -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=@suse.de header.s=susede2_rsa header.b=LG7Kws+F; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjC3DPn (ORCPT + 99 others); Wed, 29 Mar 2023 23:15:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjC3DPk (ORCPT ); Wed, 29 Mar 2023 23:15:40 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E0A5251; Wed, 29 Mar 2023 20:15:39 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BDA581FE34; Thu, 30 Mar 2023 03:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1680146136; h=from:from:reply-to: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=kzy6Pb0I2uQLf973vpyQORm+NRKHxqi2ygEi20JdAb0=; b=LG7Kws+FSdKQd65L1yHCvOQxlwuZeeGqFM3pEmvKyFnto8ljk21kY1YRaRYJb/SAvBEDRK +r6GTLQ0DBr41gXwx6vcToklb6Ek/vUoDvYEFdffh/nkBF8GdAgp0X6M7pYSqleVUuxVL4 r6hrgBlpowlwDQMW4mheljJpQ5Oq5iw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1680146136; h=from:from:reply-to: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=kzy6Pb0I2uQLf973vpyQORm+NRKHxqi2ygEi20JdAb0=; b=dLKz+exyeieg6MT2emN+Se3wCkh/B5CDuVi8QcBhHCdbxo4GUTarjmnTbuVjN38kfRRUTC SdEvtOxQyb/pcZCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 259901377E; Thu, 30 Mar 2023 03:15:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uvCpM9X+JGRiEAAAMHmgww (envelope-from ); Thu, 30 Mar 2023 03:15:33 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: "NeilBrown" To: "Xiao Ni" Cc: "Jes Sorensen" , "Mariusz Tkaczyk" , "Song Liu" , "Linux regressions mailing list" , "linux-raid" , "LKML" , "Nikolay Kichukov" Subject: Re: [PATCH - mdadm] mdopen: always try create_named_array() In-reply-to: References: <167875238571.8008.9808655454439667586@noble.neil.brown.name>, , <167945548970.8008.8910680813298326328@noble.neil.brown.name>, <168012671413.8106.6812573281942242445@noble.neil.brown.name>, Date: Thu, 30 Mar 2023 14:15:30 +1100 Message-id: <168014613094.14629.7292916705339147692@noble.neil.brown.name> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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, 30 Mar 2023, Xiao Ni wrote: > On Thu, Mar 30, 2023 at 5:52 AM 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 "name" 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] == 0) > > name = 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 "name" > > 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