Skip to content

Commit

Permalink
UBI: init_volumes: Ignore volumes with no LEBs
Browse files Browse the repository at this point in the history
UBI assumes that ubi_attach_info will only contain ubi_ainf_volume
structures for volumes with at least one LEB.
In scanning mode this is true because UBI can nicely create a ubi_ainf_volume
on demand while creating the EBA table.

For fastmap this is not true, the fastmap on-flash structure has a list of
all volumes, the ubi_ainf_volume structures are created from this list.
So it can happen that an empty volume ends up in init_volumes().

We can easely deal with that by looking into ->leb_count too.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
richardweinberger authored and dedekind committed Jul 19, 2014
1 parent d4eb08f commit e8c235b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/ubi/vtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ static int init_volumes(struct ubi_device *ubi,

/* Static volumes only */
av = ubi_find_av(ai, i);
if (!av) {
if (!av || !av->leb_count) {
/*
* No eraseblocks belonging to this volume found. We
* don't actually know whether this static volume is
Expand Down

0 comments on commit e8c235b

Please sign in to comment.