Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171725286
D38619.id117333.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38619.id117333.diff
View Options
diff --git a/lib/libefivar/efivar-dp-xlate.c b/lib/libefivar/efivar-dp-xlate.c
--- a/lib/libefivar/efivar-dp-xlate.c
+++ b/lib/libefivar/efivar-dp-xlate.c
@@ -136,8 +136,9 @@
char buf[MAX_DP_TEXT_LEN];
char *pwalk;
struct gprovider *pp, *provider;
- struct gconsumer *cp;
struct statfs *mnt;
+ struct gclass *glabel;
+ struct ggeom *gp;
walker = media = dp;
@@ -217,6 +218,16 @@
rv = errno;
goto errout;
}
+
+ /*
+ * Find glabel, if it exists. It's OK if not: we'll skip searching for
+ * labels.
+ */
+ LIST_FOREACH(glabel, &mesh->lg_class, lg_class) {
+ if (strcmp(glabel->lg_name, G_LABEL) == 0)
+ break;
+ }
+
provider = pp;
for (i = 0; i < n; i++) {
/*
@@ -225,7 +236,7 @@
* we'll need to invent one, but its decoding will be handled in
* a separate function.
*/
- if (mnt[i].f_mntfromname[0] != '/')
+ if (strncmp(mnt[i].f_mntfromname, "/dev/", 5) != 0)
continue;
/*
@@ -235,15 +246,21 @@
break;
/*
- * Next see if it is attached via one of the physical disk's
- * labels.
+ * Next see if it is attached via one of the physical disk's labels.
+ * We can't search directly from the pointers we have for the
+ * proivder, so we have to cast a wider net for all labels and
+ * filter those down to geoms whose name matches the PART provider
+ * we found the efimedia attribute on.
*/
- LIST_FOREACH(cp, &provider->lg_consumers, lg_consumer) {
- pp = cp->lg_provider;
- if (strcmp(pp->lg_geom->lg_class->lg_name, G_LABEL) != 0)
+ if (glabel == NULL)
+ continue;
+ LIST_FOREACH(gp, &glabel->lg_geom, lg_geom) {
+ if (strcmp(gp->lg_name, provider->lg_name) != 0)
continue;
- if (strcmp(g_device_path(pp->lg_name), mnt[i].f_mntfromname) == 0)
- goto break2;
+ LIST_FOREACH(pp, &gp->lg_provider, lg_provider) {
+ if (strcmp(pp->lg_name, mnt[i].f_mntfromname + 5) == 0)
+ goto break2;
+ }
}
/* Not the one, try the next mount point */
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 14, 1:31 AM (19 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38880599
Default Alt Text
D38619.id117333.diff (1 KB)
Attached To
Mode
D38619: efivar: Really look for labels for the provider with right efimedia
Attached
Detach File
Event Timeline
Log In to Comment