Skip to content

Commit 294a8db

Browse files
Hou Taorichardweinberger
authored andcommitted
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: Hou Tao <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent c16f39d commit 294a8db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/mtd/ubi/wl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,8 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
18751875
goto out_free;
18761876

18771877
#ifdef CONFIG_MTD_UBI_FASTMAP
1878-
ubi_ensure_anchor_pebs(ubi);
1878+
if (!ubi->ro_mode && !ubi->fm_disabled)
1879+
ubi_ensure_anchor_pebs(ubi);
18791880
#endif
18801881
return 0;
18811882

0 commit comments

Comments
 (0)