From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.171.202.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796420227; b=k7fZssZ2AASQaU+GjlZtoLMXc1lnTzd8VnCmrkuOxLa9a94du8LLA0Z3jD2zOdpAb+g6 y5oKWVZ1ArOj27VH1v8HH5xemT016vi06k9O6QPbhH2fCxUMiu8GOHEOvSNBBwNLn6jMK kdEXl5PfV9wAOrd7iHBXygpt8UsOf2awUrrCTJb5U1MUifg0pxEzasXZhdL8v4JNMsLwm JLj7Tj8qyCGeuHrtk5gnyqHGiXju2I0tVjez24yQvQ+QQX4SfgYa77OYy+oF6SHQubqb8 eXjY32UYlM2SgFIrt0JO41xwmkscs0581VdsDhyjayxaW5HTDwMOCgHKyYZtAwVoNWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796420227; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:To:Cc: Subject:In-Reply-To:References:User-Agent:Date:Message-ID: MIME-Version:Content-Type:X-Last-TLS-Session-Version; bh=mBrbMXPQfERVhMQpOgCSFe+HerOPAkePUm+4M4BNie4=; b=jd/IVodyO3enqEfjEteLMnJSS7DQg26k2FE224BCWevm6fmk/BhSvOrWL7xLoObKGHC5 LrH7sNkAfTWWZP23FL9Y7qMjRJjLOwlWqptfgSEdfEC4Xij2Hiu6P25P6sJub2kcvyMon SnoehDQwW+W+QAMdLme/kAnLrEz3nrQ2AjdBlg9iB5DTjvRGtPuGo0l0T5v/aWwDrS3XL XLE7OZcufVGSL0Woqhrw2exB98dq0rMBpmNgKtfFiwrZI4Yi1Vy6oCWjWJM6+qbsNocgq 6sXPesMtkDaCg1dY9y2SXAjJ7VrhxAnivFVceDcRm5cLTgXIO0cTJ6kQ101sEsHRIYg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=1q74iyQe; arc=none smtp.remote-ip=185.171.202.116 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BB5C606A322; Fri, 4 Dec 2026 21:37:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4BB5C606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=1q74iyQe Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 5F2B9C026DC; Fri, 4 Dec 2026 21:37:17 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 37ED0603C4; Fri, 4 Dec 2026 21:37:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1029511EA0CC9; Fri, 04 Dec 2026 22:36:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796420220; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=mBrbMXPQfERVhMQpOgCSFe+HerOPAkePUm+4M4BNie4=; b=1q74iyQemFK60fF2maM+BTXCTmB2lvDpqv+QOYdqd7im73+UUUVGPnSudtPDHB946slnZz vcidKCeXqe+hEWYBeE9fmgEIlSLpGmK2udxqAivsSWhSg0LLEMyiD1aB5PdNiPw3Xofik3 Yl2uSXTWY6ettERvbN0cTTKmhvYHZhbZzsOglf8Boeo6I/OH5wCjTvZORm2NoJZ/b+pbwb TG332V52t1novAi9PQarE4N/1oHjH5VNca6IdgBYqcbZRjIhWfR1OIPqycHn3rbCK8tdfR WJi5Cn6qHtPGbtDFbsQlPdhLph9JYr/YKSYRtYwWPCOWwduIMnqZI5cYylyaaA== From: Miquel Raynal To: James Hilliard Cc: Richard Weinberger , Vignesh Raghavendra , Jens Axboe , Jan Kara , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Edward Adam Davis Subject: Re: [PATCH v2] mtd: leave the device type unset when naming fails In-Reply-To: <20261108-submit-mtd-devname-retry-v1-v2-1-09f576bcc51f@gmail.com> (James Hilliard's message of "Sun, 08 Nov 2026 15:48:48 -0700") References: <20261108-submit-mtd-devname-retry-v1-v2-1-09f576bcc51f@gmail.com> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Fri, 04 Dec 2026 22:36:55 +0100 Message-ID: <874ics683s.fsf@bootlin.com> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain X-Last-TLS-Session-Version: TLSv1.3 On 08/11/2026 at 15:48:48 -07, James Hilliard wrote: > add_mtd_device() uses dev.type to reject a second registration of the > same MTD. It sets that field before dev_set_name(), but the failure path > for the name allocation leaves it set even though no device was > registered. Retrying registration then warns and fails with -EEXIST. > > Set the type only after naming succeeds. The later registration error > paths already clear it before releasing the device. > > Fixes: 6697dae1e2da ("mtd: capture device name setting failure when adding mtd") > Cc: stable@vger.kernel.org > Signed-off-by: James Hilliard No longer applies, please rebase.