diff options
author | Hou Tao <houtao1@huawei.com> | 2020-02-10 16:26:35 +0300 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2020-03-31 00:02:36 +0300 |
commit | 294a8dbe34d3b2f6e48eb9058ed21d7fe9348b6b (patch) | |
tree | 0d3acda683d6039fa6d04ee88752b325d091ebe4 /drivers/mtd/ubi/wl.c | |
parent | c16f39d14a7e0ec59881fbdb22ae494907534384 (diff) | |
download | linux-294a8dbe34d3b2f6e48eb9058ed21d7fe9348b6b.tar.xz |
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 <houtao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/ubi/wl.c')
-rw-r--r-- | drivers/mtd/ubi/wl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 837d690a8c60..5146cce5fe32 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -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; |