X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffstools.git;a=blobdiff_plain;f=block.c;h=6c025fdce4963eb6169a37517637d9ee6873dde4;hp=4d823e6bec562685c4b8770fab694f94271aa9dc;hb=b98642a50b0cd11696eaad151638f8cf9d153c40;hpb=5b61e27d36e5bbf40825a4ae14920efe47d36f02 diff --git a/block.c b/block.c index 4d823e6..6c025fd 100644 --- a/block.c +++ b/block.c @@ -464,6 +464,16 @@ static int config_load(char *cfg) static struct blkid_struct_probe* _probe_path(char *path) { struct blkid_struct_probe *pr; + char tmppath[64]; + + /* skip ubi device if ubiblock device is present */ + if (path[5] == 'u' && path[6] == 'b' && path[7] == 'i' && + path[8] >= '0' && path[8] <= '9' ) { + snprintf(tmppath, sizeof(tmppath), "/dev/ubiblock%s", path + 8); + list_for_each_entry(pr, &devices, list) + if (!strcasecmp(pr->dev, tmppath)) + return NULL; + } pr = malloc(sizeof(*pr));