svn commit: r270149 - head/sys/geom

Scott Long scottl at FreeBSD.org
Mon Aug 18 19:27:48 UTC 2014


Author: scottl
Date: Mon Aug 18 19:27:47 2014
New Revision: 270149
URL: http://svnweb.freebsd.org/changeset/base/270149

Log:
  Deal explicitly with possible failures of make_dev_alias_p() in GEOM.
  
  Submitted by:   Mariusz Zaborski <oshogbo at FreeBSD.org>
  MFC after:      3 days

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==============================================================================
--- head/sys/geom/geom_dev.c	Mon Aug 18 18:07:28 2014	(r270148)
+++ head/sys/geom/geom_dev.c	Mon Aug 18 19:27:47 2014	(r270149)
@@ -251,9 +251,10 @@ g_dev_taste(struct g_class *mp, struct g
 			snprintf(buf, sizeof(buf), "%s%s",
 			    val, gp->name + len);
 			freeenv(val);
-			make_dev_alias_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK,
-			    &adev, dev, "%s", buf);
-			adev->si_flags |= SI_UNMAPPED;
+			if ((make_dev_alias_p(MAKEDEV_CHECKNAME|MAKEDEV_WAITOK,
+			    &adev, dev, "%s", buf)) != 0)
+				printf("Warning: unable to create device "
+				    "alias %s\n", buf);
 			break;
 		}
 	}
@@ -263,6 +264,7 @@ g_dev_taste(struct g_class *mp, struct g
 	if (adev != NULL) {
 		adev->si_iosize_max = MAXPHYS;
 		adev->si_drv2 = cp;
+		adev->si_flags |= SI_UNMAPPED;
 	}
 
 	g_dev_attrchanged(cp, "GEOM::physpath");


More information about the svn-src-head mailing list