From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.85.4 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796420276; b=FkPRmWSUk22cIxaPD76H4U+9ZCagHtMz/09iF4W2/owrY0+3bGjkadW+HMvI7P7zQxTY DXrZ2KI5IEEyEAc7fZwrBfGVr6/JXqxQyiba3RL3yTjx4HXSurrSZyyw8Z7IuZhCTrX30 K6H4DaHiDBn4j1+AExC9z7GsaLKrNLdFI/B3266wROPEmQ3MlXX4GTFpTHJ3x69FDJhmE PRCMOu0YqSjAJJVS/LLisiC1BR7ZeAJzQsORaIuzfzkgZKxKmQfA1oEX/qHSVGKNehOwf E/IQcVHdL2BzNQLGxYzA7z/2IiBD2iKPDtJerrpjQGduwc6XNUaW8IfwTtfehHZurGw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796420276; 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=lN7LAZNZsTKkw+gmi8kjZcVkUtCSvElICs4ewnkQoGA=; b=uxgp3eYnaaBl397WHJ6U5zHm+Y5siRskh03mfCmPW8lRW39Np+pgBkkxRy0VR23l7Rac Ltv8ebIr8kFqnJRq5qn5xf9FCbRDnnIzwcIzNMjTTLnY26NsJeQ5MAC7r6Eo5MTSGKNFx Sb5JyTOL1bzNFZXLXBu78Sz/ZtGTY+hGBO2d9F0sA+0rhIrPKkkca0kHlQX6DA/M39KQV thN4F+zxNONTftIsY7dyrfs2ECutOkh/OyDoCgVSrE7UNUB25HQvNZBHKZX+zP9wnunPF zM7L9sClhaA8uct5nxhyYyz21LNNHY/rQP66gcYjr0mTwOBpoviVhBegGaeCMys9Kmw== 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=XzvVlfsc; arc=none smtp.remote-ip=185.246.85.4 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 00BFB606A32C for ; Fri, 4 Dec 2026 21:37:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 00BFB606A32C 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=XzvVlfsc Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 6A2FE4E4189C; Fri, 4 Dec 2026 21:37:54 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2F1C8603C4; Fri, 4 Dec 2026 21:37:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2527311EA0CC9; Fri, 04 Dec 2026 22:37:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796420273; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=lN7LAZNZsTKkw+gmi8kjZcVkUtCSvElICs4ewnkQoGA=; b=XzvVlfsc3GCNradxwv8AXWE3gTHxJK+sByWIgZjgl0tnUKqW2qH1f6+QQBgaH0LLPks/WO cQrjbsylqZr265w3Vw141gTLwZKKo0wZb5oAhxvGCWX/oUkWyZD9rnAtz+eq2+yyew7QR3 eYyRjp9H4NqcpvbfxCKUgd/XvrGlr7ToKEEzX+cEYIaKtyRY34S6ZoQQKrOiBYd4BLwnHN CjUC8B0phlk4o5HJ49DiFIn6hdtDpp/+XeEJkBtOecujdyQzf7KMcRp88FFASycPldh4aS zTy+DDFdGuKhGpm1VG22MzRPkFae6hKixcoXEVDVXvQYcrSA8Ii2nz5aAQxPnw== From: Miquel Raynal To: James Hilliard Cc: Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] mtd: take a reference when opening an unpartitioned master In-Reply-To: <20261120-submit-mtd-master-open-reference-v1-v2-1-5c2e2ede4ea7@gmail.com> (James Hilliard's message of "Fri, 20 Nov 2026 09:01:35 -0700") References: <20261120-submit-mtd-master-open-reference-v1-v2-1-5c2e2ede4ea7@gmail.com> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Fri, 04 Dec 2026 22:37:51 +0100 Message-ID: <87y0a44ths.fsf@bootlin.com> X-Mailing-List: linux-kernel@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 20/11/2026 at 09:01:35 -07, James Hilliard wrote: > With CONFIG_MTD_PARTITIONED_MASTER disabled, a flash device with no > partitions still gets a /dev/mtdX node. Opening that node does not take > a reference on the master MTD. If the driver unregisters the flash > before the file is closed, the core can unregister the MTD device and > its NVMEM provider while the file is still open. > > Take a master reference for a handle on the master and drop it when the > handle is released. A handle on a partition still takes a master > reference only when CONFIG_MTD_PARTITIONED_MASTER is enabled. > > Fixes: 264725e35fbc ("mtd: Clean refcounting with MTD_PARTITIONED_MASTER") > Cc: stable@vger.kernel.org > Signed-off-by: James Hilliard Guess what, doesn't apply either.