Commit 294a8dbe authored by Hou Tao's avatar Hou Tao Committed by Richard Weinberger
Browse files

ubi: fastmap: Only produce the initial anchor PEB when fastmap is used



Don't produce the initial anchor PEB when ubi device is read-only
or fastmap is disabled, else the resulting PEB will be unusable
to any volume.

Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent c16f39d1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1875,6 +1875,7 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
		goto out_free;

#ifdef CONFIG_MTD_UBI_FASTMAP
	if (!ubi->ro_mode && !ubi->fm_disabled)
		ubi_ensure_anchor_pebs(ubi);
#endif
	return 0;