From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 373A9882B for ; Wed, 29 Mar 2023 21:52:08 +0000 (UTC) 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 Precedence: bulk X-Mailing-List: regressions@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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> 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