Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8678aeb7 authored by Richard Weinberger's avatar Richard Weinberger Committed by Ian Maund
Browse files

UBI: Fastmap: Set used_ebs only for static volumes



If we set it for dynamic ones we might confuse various self checks.

Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Git-commit: 42dd3cdcd6b5671ebedc3df76ca8dcc3473bcc67
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarNikhilesh Reddy <reddyn@codeaurora.org>
parent 6cc9c7cf
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -136,14 +136,15 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id,
	if (!av)
	if (!av)
		goto out;
		goto out;


	av->highest_lnum = av->leb_count = 0;
	av->highest_lnum = av->leb_count = av->used_ebs = 0;
	av->vol_id = vol_id;
	av->vol_id = vol_id;
	av->used_ebs = used_ebs;
	av->data_pad = data_pad;
	av->data_pad = data_pad;
	av->last_data_size = last_eb_bytes;
	av->last_data_size = last_eb_bytes;
	av->compat = 0;
	av->compat = 0;
	av->vol_type = vol_type;
	av->vol_type = vol_type;
	av->root = RB_ROOT;
	av->root = RB_ROOT;
	if (av->vol_type == UBI_STATIC_VOLUME)
		av->used_ebs = used_ebs;


	dbg_bld("found volume (ID %i)", vol_id);
	dbg_bld("found volume (ID %i)", vol_id);