diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index b967191cc97e5dc827aefc5d0c9fcf74ffd32cca..8f1f9feb2d60dca5c5a092ea323ff105989763e4 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -246,7 +246,7 @@ static ssize_t dev_attribute_show(struct device *dev, else if (attr == &dev_total_eraseblocks) ret = sprintf(buf, "%d\n", ubi->good_peb_count); else if (attr == &dev_volumes_count) - ret = sprintf(buf, "%d\n", ubi->vol_count); + ret = sprintf(buf, "%d\n", ubi->vol_count - UBI_INT_VOL_COUNT); else if (attr == &dev_max_ec) ret = sprintf(buf, "%d\n", ubi->max_ec); else if (attr == &dev_reserved_for_bad) diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index 42d3dd70f2d02808db6d9b45e704872351d02b14..177227e1f80dc2f73d5b98d4512c989f9ae0c717 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -357,6 +357,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) spin_lock(&ubi->volumes_lock); ubi->volumes[vol_id] = vol; + ubi->vol_count += 1; spin_unlock(&ubi->volumes_lock); paranoid_check_volumes(ubi);