From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3CA2F606A334 for ; Fri, 4 Dec 2026 21:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Pf2YEoni; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=XzvVlfsc DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=Ys7UureASLHsL2rpj16Z1f7MwxUDM8r+y+YfsRvDKys=; b=Pf2YEoniZF+KJX+oi/ilkucT6u vp/jml4TM544JAtBqqwSF0B+HmCalPeOiWfo/ODEKbptoMEIsPR7Y+nYH8JTLHcdypkFhaMBRPDi9 DzUIwzU2kyywPX6MKZu4PPe+t7MwSeucVJ77rMi3H90DbaTSamNPgxzB8WyoWw+GidnZFmPgqdZUQ fT7GHishUE2N+p5aVZpdmQsaV9pp2ryy/KN+gNPV4OvOJhqE4exqqnGV6TORSAFcMkN2AcB0hwXaK Qn5FpxSoJWvVtvA/mOIVfTkdsMbj7QxFTqOlzAz83YXu4CtUwaYyQNz7UL35SvlhL3N8wEOqwHe1q fICDKxFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZayc-00000001ZL5-3HRR; Fri, 04 Dec 2026 21:37:58 +0000 Received: from smtpout-03.galae.net ([185.246.85.4]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZaya-00000001ZJN-0Fzu for linux-mtd@lists.infradead.org; Fri, 04 Dec 2026 21:37:57 +0000 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-Archived-By: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_133756_283988_F9E99A6C X-CRM114-Status: GOOD ( 11.91 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" X-Spam-Status: No, score=-9.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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. ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ 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.