Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1234833rwl; Wed, 29 Mar 2023 14:52:58 -0700 (PDT) X-Google-Smtp-Source: AKy350YRFDhF5Dc8KVbe9ATAzpDgR23KysWUxxXTUuN6xumMJiYshVMk88b2uUg7DJ+DLFBnx6Rb X-Received: by 2002:a17:902:ce8e:b0:1a0:65ae:df32 with SMTP id f14-20020a170902ce8e00b001a065aedf32mr26094528plg.37.1680126777938; Wed, 29 Mar 2023 14:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680126777; cv=none; d=google.com; s=arc-20160816; b=aqY03LGNJR8z7Er6sO7EZIIGkpJSDPwKn1G06ojlX4eO86kXr5Ym6EfQZfkhQhGJY5 h/8QXkIsJBKQD5FYL01YvZGE/RjNQtMvuZEOBKu/R+8yMuZWiFV40PniD9tjPhl53VtC TLnaFz/PTETRToQB4oh3qRGdENXm45f/89haHX/+GWgerH1E4xNxsxaVtBZOvq4IPE8e UVW+LreD/GnJ8TfIymfxUw+J9PuvJlvuBNAVEKvlDr/gaL7cbANHTaBJXsDZ6aRFe818 C8FUlrLwJoijwgTMAt9yXaxQ5BaPsXqwZDLrdqi9Vr7cKPlpz74FeANDWAhUIer6sL24 I+hQ== 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=gbyasE+U5G0etNVXeDJPsM6LV+TgTAw9J2CMCHV/AKk=; b=PKWt1pTsZacBUZ2bPxA18AGVdSLTdobR30jH5lvudBX6bCvF6iTp55bdHOhYCvmGwL g6XrbM8heVeKMkn2FlifDiHvb4lqtWw6SSb8wOlDbeGSEJCAmTllnCVN2kIPVhonYnqx yCP5ajrfmF8kS9NsxBus3els7E5yk5fytDiMT+mv2nxiFquTNwhzPvWwphCN5NtNYJ1a YpptRyvkDgKzPubi1muH1WlYwI4hjSFOeDV8HfmKONrud4KoKXv5IwffNSVDJ7WUXVXc yaJ2oKAx9XqWBdmzh+zLSs8XIvtBKYuJA1PqDPyPCGJV+vXHaoffkfgKm09H3D8BFqRO YlOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=bJWmz8jb; dkim=neutral (no key) header.i=@suse.de header.b="cp+/JNy6"; 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 c12-20020a170902848c00b0019edbe2894fsi31036812plo.504.2023.03.29.14.52.45; Wed, 29 Mar 2023 14:52:57 -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=bJWmz8jb; dkim=neutral (no key) header.i=@suse.de header.b="cp+/JNy6"; 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 S230171AbjC2VwX (ORCPT + 99 others); Wed, 29 Mar 2023 17:52:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbjC2VwP (ORCPT ); Wed, 29 Mar 2023 17:52:15 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 600F9524F; Wed, 29 Mar 2023 14:52:05 -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-out1.suse.de (Postfix) with ESMTPS id 0E56821ABF; Wed, 29 Mar 2023 21:52:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1680126724; 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=gbyasE+U5G0etNVXeDJPsM6LV+TgTAw9J2CMCHV/AKk=; b=bJWmz8jbUMFtFdRf84YxkPJz179Q8SYLD8FkEV/Ai+5Kwf0zn/qsjQAhKQPcgmAAaEBXUD ZHVOTAPDEgnphqEXXh/c2Phhes5xzpDHHakoGi2chnlRHo+H0V1k8eJR1NCvi1y9RNs/hq xwpianAeCln+vtsuD8RjPnW5aHlmL08= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1680126724; 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=gbyasE+U5G0etNVXeDJPsM6LV+TgTAw9J2CMCHV/AKk=; b=cp+/JNy6F1c42CVnU5n0CDpAbXfsyYWkk5DlKhbkDm9yokxdP28jIOn14Umj2GJXUnNE/Z bmegeFteuLxUEKBw== 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 6C10A139D3; Wed, 29 Mar 2023 21:52:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id r5u+CAGzJGSvCwAAMHmgww (envelope-from ); Wed, 29 Mar 2023 21:52:01 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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: <167945548970.8008.8910680813298326328@noble.neil.brown.name> References: <167875238571.8008.9808655454439667586@noble.neil.brown.name>, , <167945548970.8008.8910680813298326328@noble.neil.brown.name> Date: Thu, 30 Mar 2023 08:51:54 +1100 Message-id: <168012671413.8106.6812573281942242445@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 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