From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.84.56 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796420276; b=31wTVXGmiS09fO3NNzqH+a6uDXZ7sxGsQVgzMwvhD9lpvvShIsZib13iiGlW3/yF8SuR WgnmJQ+WpdM0zPWrbyWjo4we+jfn9Ur9+/ocyTL3JFB/fRDjeuC5eysL4XYTY/CU04St7 gxxm9vfG5BOI++RsY34kGWSsFChFh9YlKaA/LLQ5liFsaocKl6x94nJvoSjZGg6jZeAne 5kM5j2lQSUI4lYJotmi0w+4oYOeT9adnMLbA4wQzKKeNo2Vf+NA9ZthPig7nTkoTfhgFb o5n+gLw1dFMmlD0NwMr/nhjkd6UEXFFkbGVarjdaTCAzrL+wxP4OezYrJqWLy0I9E7w== 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=EJhZFAPQD6/C1S8FnmljmSbEUHJY0JdYA059xQc6N/6Bt6Gyisbb929puh6f1JeW8Q6i 0jHFtDpMgluq4VwgxPA8VG65mbmoFMrzQl2+7y7WiEROaCMWTMyf+6tAiNwEcSs0MHb3R vLorCCpGXbR2jSyBMCrogh++IZkydq6YB4DqBYCi6tw9KIZuJ+yEQq4H0oqWe0Kb1Q5Zv 7JWTI0WQC1iDNa7xYyuPog4aIiGeiz1fw0wSShI9Ph4+9kMLX0ah9Yg3+wH8UELxgNmIk Mn2km3TqoDl8F9c3FpRLjLYn5C88iN0G1mdiRoae4KRvcZdS0eyVULIWLiHGIwi0eAA== 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.84.56 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 AA67C606A322 for ; Fri, 4 Dec 2026 21:37:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AA67C606A322 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-02.galae.net (Postfix) with ESMTPS id 600C41A1938; 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: 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 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.