Skip to contentSkip to conversation

Patch "dm: fix alloc_dax error handling in alloc_dev" has been added to the 5.16-stable tree

dm-devel Sasha Levin 1 participant 1 message Jan 23, 2022 Device mapper

lore
Share & tools
lore

Sasha Levin

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

dm: fix alloc_dax error handling in alloc_dev

to the 5.16-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
dm-fix-alloc_dax-error-handling-in-alloc_dev.patch
and it can be found in the queue-5.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

commit 383888701205a2a2fe35a13d4b2491817bea4d61

Author: Christoph Hellwig <[email protected]>
Date:   Mon Nov 29 11:21:35 2021 +0100

dm: fix alloc_dax error handling in alloc_dev

[ Upstream commit d751939235b9b7bc4af15f90a3e99288a8b844a7 ]

Make sure ->dax_dev is NULL on error so that the cleanup path doesn't trip over an ERR_PTR.

drivers/md/dm.c +3 -1
index 662742a310cbb..acc84dc1bded5 100644
@@ -1786,8 +1786,10 @@ static struct mapped_device *alloc_dev(int minor)
 	if (IS_ENABLED(CONFIG_DAX_DRIVER)) {
 		md->dax_dev = alloc_dax(md, md->disk->disk_name,
 					&dm_dax_ops, 0);
-		if (IS_ERR(md->dax_dev))
+		if (IS_ERR(md->dax_dev)) {
+			md->dax_dev = NULL;
 			goto bad;
+		}
 	}
 
 	format_dev_t(md->name, MKDEV(_major, minor));

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel