All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] dax-device-defer-publishing-the-dynamic-pgmap.patch removed from -mm tree
@ 2026-09-29 21:56 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-09-29 21:56 UTC (permalink / raw)
  To: mm-commits, vishal.l.verma, stable, joao.m.martins, dave.jiang,
	alison.schofield, yaojiale02, akpm


The quilt patch titled
     Subject: dax/device: defer publishing the dynamic pgmap
has been removed from the -mm tree.  Its filename was
     dax-device-defer-publishing-the-dynamic-pgmap.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Jiale Yao <yaojiale02@163.com>
Subject: dax/device: defer publishing the dynamic pgmap
Date: Sun, 27 Sep 2026 19:47:36 +0800

The dynamic device-dax probe path publishes its devm-allocated pgmap
before several operations that can still fail.  If one of them fails,
devres frees the pgmap while dev_dax->pgmap remains non-NULL.  A later
bind then fails the dynamic-dax invariant check and leaves the device
unusable until its region is recreated.

Defer assigning dev_dax->pgmap until the final devm action has been
installed and probe can no longer fail.  A failed probe then never
publishes the temporary pgmap.

Link: https://lore.kernel.org/20260927114736.1113965-1-yaojiale02@163.com
Fixes: fc65c4eb0b2a ("device-dax: ensure dev_dax->pgmap is valid for dynamic devices")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Alison Schofield <alison.schofield@intel.com>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: <stable@vger.kernel.org>
---

 drivers/dax/device.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/drivers/dax/device.c~dax-device-defer-publishing-the-dynamic-pgmap
+++ a/drivers/dax/device.c
@@ -409,7 +409,6 @@ static int dev_dax_probe(struct dev_dax
 			return -ENOMEM;
 
 		pgmap->nr_range = dev_dax->nr_range;
-		dev_dax->pgmap = pgmap;
 
 		for (i = 0; i < dev_dax->nr_range; i++) {
 			struct range *range = &dev_dax->ranges[i].range;
@@ -450,7 +449,13 @@ static int dev_dax_probe(struct dev_dax
 		return rc;
 
 	run_dax(dax_dev);
-	return devm_add_action_or_reset(dev, dev_dax_kill, dev_dax);
+	rc = devm_add_action_or_reset(dev, dev_dax_kill, dev_dax);
+	if (rc)
+		return rc;
+
+	/* Probe can no longer fail; expose the pgmap via dev_dax. */
+	dev_dax->pgmap = pgmap;
+	return 0;
 }
 
 static struct dax_device_driver device_dax_driver = {
_

Patches currently in -mm which might be from yaojiale02@163.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-29 21:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-29 21:56 [merged] dax-device-defer-publishing-the-dynamic-pgmap.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.