Skip to content

Commit

Permalink
ubi: fastmap: Only produce the initial anchor PEB when fastmap is used
Browse files Browse the repository at this point in the history
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: Hou Tao <houtao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Hou Tao authored and Richard Weinberger committed Mar 30, 2020
1 parent c16f39d commit 294a8db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mtd/ubi/wl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,8 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
goto out_free;

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

Expand Down

0 comments on commit 294a8db

Please sign in to comment.